Skip to content

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. The app.* and identify.remaining gauges come from the process that runs shard 0, every 30 minutes.
MetricKindUnitFromDescription
interactionscountercountinteraction, message_commandCommands, 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_guildcountercountinteraction, message_commandThe same runs split by server, kind, command and outcome only, so the main rollup does not grow with commands × servers.
interactions.autocompletecountercountinteractionAutocomplete requests, by command and focused option.
componentscountercountinteractionButton and select-menu interactions, by normalised custom ID and source command.
interactions.errorscountercountinteraction_errorWrapped handlers that failed after the first response, by command and error class.
commands.permissionscountercountcommand_permissionsServers changing who may use commands (command lockdowns). Each change is stored, but not summed into rollups or shown in the dashboard.
modals.showncountercountinteractionInteraction callbacks of type 9 (modal shown), by command.
modals.submittedcountercountinteractionModal submissions, by normalised custom ID.
rest.callscountercountrest_windowREST calls by bucketed route, method and status, with a latency histogram.
rest.invalidcountercountrest_window401, 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.ratelimitscountercountrate_limit429 responses by scope (user, global, shared) and route.
guild.joinscounterserversguild_join, guild_snapshotServers that added the bot, including joins detected at startup.
guild.leavescounterserversguild_leave, guild_snapshotServers that removed the bot, including removals detected at startup.
guild.unavailablecounterserversguild_availabilityServer outages reported by Discord (kept apart from removals).
shard.eventscountercountshard_stateShard lifecycle events (ready, resumed, reconnecting, disconnected, error, invalidated), listed one by one on the Reliability page rather than summed into rollups.
entitlementscountercountentitlement, webhookEntitlements created, updated and deleted, by SKU, from the gateway and from Discord webhook events.
subscriptionscountercountsubscriptionSubscriptions created, updated and deleted, by status.
custom.<name>countercountcustomCustom events sent with `track()`, one metric per event name.
webhook.<type>countercountwebhookDiscord webhook events received by the collector, one metric per event type.
shard.ping_msgauge (per shard)msgauge_windowGateway heartbeat latency, sampled every 30 seconds.
shard.guildsgauge (per shard)serversgauge_windowServers on the shard. The total server count is the sum of the latest value per shard.
eventloop.p99_msgaugemsgauge_windowEvent-loop delay p99 in the bot process over the last sample window.
memory.rss_bytesgaugebytesgauge_windowResident set size of the bot process.
memory.heap_used_bytesgaugebytesgauge_windowV8 heap in use in the bot process.
cache.usersgaugecountgauge_windowSize of the discord.js user cache.
cache.channelsgaugecountgauge_windowSize of the discord.js channel cache.
rest.invalid_warning_countgaugecountinvalid_request_warningInvalid 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.remaininggaugesessionsapp_infoRemaining identify calls in the current 24-hour window (`session_start_limit.remaining`).
app.approx_guildsgaugeserversapp_infoDiscord's approximate server count for the application.
app.approx_user_installsgaugeusersapp_infoDiscord'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.