Metrics
This page is generated from the metric registry in @shardlens/schema, the list the collector’s rollups and gauges
follow. From names the wire event types each metric is computed from; webhook means
Discord webhook events the collector receives itself.
- Counters are summed into minute, hour and day rollups, kept for 14 days, 13 months and for good. Two are stored as single events instead, as their descriptions say.
- Histograms use 40 fixed buckets on a logarithmic scale from 1 ms to 60 s, so percentiles can be merged across shards and time ranges. A percentile is reported as the upper edge of the bucket it falls in: up to a third above the true value, never below it. Anything slower than 60 s lands in the last bucket and reads as about 80 s.
- Gauges are samples, kept for 30 days. Process gauges come from every shard and process every 30 seconds: totals
(
shard.guilds,memory.*,cache.*) are added up across them, and latencies (shard.ping_ms,eventloop.p99_ms) are averaged, with the worst kept as the maximum. Theapp.*andidentify.remaininggauges come from the process that runs shard 0, every 30 minutes.
| Metric | Kind | Unit | From | Description |
|---|---|---|---|---|
interactions | counter | count | interaction, message_command | Commands, context menus, entry points and message (prefix) commands run, with outcome and response-time histogram. Split by command, subcommand, kind, outcome, context, install type, locale and member tier; never by server. |
interactions.by_guild | counter | count | interaction, message_command | The same runs split by server, kind, command and outcome only, so the main rollup does not grow with commands × servers. |
interactions.autocomplete | counter | count | interaction | Autocomplete requests, by command and focused option. |
components | counter | count | interaction | Button and select-menu interactions, by normalised custom ID and source command. |
interactions.errors | counter | count | interaction_error | Wrapped handlers that failed after the first response, by command and error class. |
commands.permissions | counter | count | command_permissions | Servers changing who may use commands (command lockdowns). Each change is stored, but not summed into rollups or shown in the dashboard. |
modals.shown | counter | count | interaction | Interaction callbacks of type 9 (modal shown), by command. |
modals.submitted | counter | count | interaction | Modal submissions, by normalised custom ID. |
rest.calls | counter | count | rest_window | REST calls by bucketed route, method and status, with a latency histogram. |
rest.invalid | counter | count | rest_window | 401, 403 and 429 responses by status, toward Discord's ban at 10,000 invalid requests in 10 minutes. Shared 429s, which don't count toward it, are counted apart. |
rest.ratelimits | counter | count | rate_limit | 429 responses by scope (user, global, shared) and route. |
guild.joins | counter | servers | guild_join, guild_snapshot | Servers that added the bot, including joins detected at startup. |
guild.leaves | counter | servers | guild_leave, guild_snapshot | Servers that removed the bot, including removals detected at startup. |
guild.unavailable | counter | servers | guild_availability | Server outages reported by Discord (kept apart from removals). |
shard.events | counter | count | shard_state | Shard lifecycle events (ready, resumed, reconnecting, disconnected, error, invalidated), listed one by one on the Reliability page rather than summed into rollups. |
entitlements | counter | count | entitlement, webhook | Entitlements created, updated and deleted, by SKU, from the gateway and from Discord webhook events. |
subscriptions | counter | count | subscription | Subscriptions created, updated and deleted, by status. |
custom.<name> | counter | count | custom | Custom events sent with `track()`, one metric per event name. |
webhook.<type> | counter | count | webhook | Discord webhook events received by the collector, one metric per event type. |
shard.ping_ms | gauge (per shard) | ms | gauge_window | Gateway heartbeat latency, sampled every 30 seconds. |
shard.guilds | gauge (per shard) | servers | gauge_window | Servers on the shard. The total server count is the sum of the latest value per shard. |
eventloop.p99_ms | gauge | ms | gauge_window | Event-loop delay p99 in the bot process over the last sample window. |
memory.rss_bytes | gauge | bytes | gauge_window | Resident set size of the bot process. |
memory.heap_used_bytes | gauge | bytes | gauge_window | V8 heap in use in the bot process. |
cache.users | gauge | count | gauge_window | Size of the discord.js user cache. |
cache.channels | gauge | count | gauge_window | Size of the discord.js channel cache. |
rest.invalid_warning_count | gauge | count | invalid_request_warning | Invalid requests discord.js has counted in its current 10-minute window, from its warning event. Sent only when the bot sets discord.js's `invalidRequestWarningInterval`. |
identify.remaining | gauge | sessions | app_info | Remaining identify calls in the current 24-hour window (`session_start_limit.remaining`). |
app.approx_guilds | gauge | servers | app_info | Discord's approximate server count for the application. |
app.approx_user_installs | gauge | users | app_info | Discord's approximate user-install count for the application. |
Names ending in .<name> or .<type> are patterns: custom events from track() are counted as custom.<name>, and
Discord webhook events as webhook.<type>. The HTTP API reference lists the ones its
query route serves.