Skip to content

Data collected

This page is generated from the wire format in @shardlens/schema. A test fails the build if a field can be sent without being listed here, so the list is complete for the version these docs were built from.

Each table is one object on the wire. envelope is the batch around every request, event holds the fields every event has, and the other tables are event types (such as interaction or guild_join) or objects inside them (actor, guild_info).

  • Mode: “Both” fields are collected in privacy mode and audit mode. “Audit only” fields are sent only when both the SDK and the collector are in audit mode.
  • Personal data: “Pseudonymous” means a salted hash that can’t be reversed once its salt is destroyed. It is still personal data under UK and EU GDPR while the salt exists. “Yes” means the field identifies a person.
  • Kept: how long the collector’s database stores it. Fields marked “Not stored” are read while the batch is processed and then dropped. Raw retention is 35 days by default and configurable from 7 to 90; after raw rows expire, aggregate counts stay: minute counts for 14 days, hourly counts for 13 months and daily counts for good.

Erasure deletes every row that holds a person’s hash, and in audit mode their encrypted records, whatever the tables say about how long those would otherwise be kept.

envelope

FieldWhat it isModePersonal dataKept
vWire-format major version.BothNoNot stored; used while processing the batch only
modeData mode the SDK runs in (privacy or audit).BothNoNot stored; used while processing the batch only
sdkSDK package name and version, kept with the SDK health of the sending process.BothNoLatest value only
appDiscord application ID, environment name and bot release.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
sourceShard IDs and an instance label (host name and process ID) for the sending process, kept with its SDK health and its gauges. The cluster ID (discord-hybrid-sharding) is sent but not stored.BothNo30 days as sent (every 30 seconds for process gauges), then deleted
sentAtWhen the batch was sent; used to correct clock skew.BothNoNot stored; used while processing the batch only
eventsThe events in the batch.BothNoNot stored; used while processing the batch only

event

FieldWhat it isModePersonal dataKept
idUUIDv7 event ID; makes retries idempotent.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
tsWhen the event happened (epoch milliseconds).BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
weightInverse sample rate, so sampled counts stay accurate.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
typeEvent type.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only

interaction

FieldWhat it isModePersonal dataKept
kindSlash command, context menu, entry point, button, select, modal submit or autocomplete.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
commandCommand name.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
groupSubcommand group name.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
subSubcommand name.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
commandIdRegistered command ID.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
commandScopeWhether the command is global or registered to one server.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
optionsNames of the options used. Values are not collected.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
optionValuesValues of options the bot owner allow-listed with `captureOptionValues` only. Never user, channel, role, mentionable or attachment options, nor a value holding a Discord ID.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
customIdComponent or modal custom ID (for a command that opened a modal, the modal's), with secrets removed and numbers and IDs replaced by `*`, or as the bot's `normaliseCustomId` rewrites it.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
componentTypeComponent type number.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
sourceCommandCommand that created the message a component is on.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
contextWhere it ran: server, bot DM or private channel.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
installWhether the app was server-installed, user-installed or both.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
guildServer ID (not personal data).BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
channelTypeChannel type number. Channel IDs and names are never collected.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
localeThe user's Discord app language (not their location).BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
guildLocaleThe server's preferred language.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
memberTierAdmin, manager, member or DM, derived from the member’s permissions.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
userKeyed hash of the user ID, computed inside the bot process.BothPseudonymousIn unique-user counts until the salt for its period is destroyed (period end + 7 days); raw rows expire after 35 days (configurable 7–90)
premiumWhether the user or server has an active entitlement.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
outcomeok, error, timeout (missed 3-second deadline) or no response.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
errorCodeDiscord API error code, if the response failed.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
errorClassError class name the handler threw. Never messages or stack traces.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
ackMsMilliseconds from Discord creating the interaction to the first response.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
responseTypeInteraction callback type (for example deferred or modal).BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
deferredWhether the first response was a deferral.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
ephemeralWhether the first response was ephemeral.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
handlerMsHandler duration, when the handler is wrapped or reports when it finished.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
shardShard that received the interaction.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only

message_command

FieldWhat it isModePersonal dataKept
commandCommand name as the bot defines it, after aliases. Never the text the user typed.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
groupSubcommand group name, if the bot reports one.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
subSubcommand name, if the bot reports one.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
optionsNames of the arguments the bot reports as used. Values are not collected.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
optionValuesValues of arguments the bot owner allow-listed with `captureOptionValues` only. Never a value holding a Discord ID.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
guildServer ID (not personal data).BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
channelTypeChannel type number. Channel IDs and names are never collected.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
guildLocaleThe server's preferred language.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
memberTierAdmin, manager, member or DM, derived from the member’s permissions.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
userKeyed hash of the message author’s ID, computed inside the bot process.BothPseudonymousIn unique-user counts until the salt for its period is destroyed (period end + 7 days); raw rows expire after 35 days (configurable 7–90)
outcomeok or error, as the handler finished.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
errorClassError class name the handler threw. Never messages or stack traces.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
errorCodeDiscord API error code, if the error came from Discord.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
handlerMsHandler duration, when the bot reports it.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
shardShard that received the message.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only

interaction_error

FieldWhat it isModePersonal dataKept
interactionID of the interaction event the error belongs to.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
commandCommand name.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
errorClassError class name the handler threw. Never messages or stack traces.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
errorCodeDiscord API error code, if the error came from Discord.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
handlerMsHandler duration until it failed.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only

command_permissions

FieldWhat it isModePersonal dataKept
guildServer that changed command permissions.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
commandCommand ID, or the application ID for app-wide changes.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
overwritesNumber of permission overwrites now set. Role and user IDs are not collected.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed

guild_info

FieldWhat it isModePersonal dataKept
guildServer ID.BothNoWhile the bot is installed, plus 90 days after it leaves
nameServer name (rendered as plain text).BothNoWhile the bot is installed, plus 90 days after it leaves
iconServer icon hash.BothNoWhile the bot is installed, plus 90 days after it leaves
memberCountMember count when the profile was sent (on joining, after a restart and on server updates), or Discord's approximate count with `refreshGuildCounts`.BothNoWhile the bot is installed, plus 90 days after it leaves
largeDiscord's large-server flag.BothNoWhile the bot is installed, plus 90 days after it leaves
preferredLocaleThe server's preferred language.BothNoWhile the bot is installed, plus 90 days after it leaves
featuresServer feature flags such as COMMUNITY or PARTNERED.BothNoWhile the bot is installed, plus 90 days after it leaves
premiumTierBoost tier.BothNoWhile the bot is installed, plus 90 days after it leaves
boostsNumber of boosts.BothNoWhile the bot is installed, plus 90 days after it leaves
verificationLevelVerification level.BothNoWhile the bot is installed, plus 90 days after it leaves
nsfwLevelNSFW level.BothNoWhile the bot is installed, plus 90 days after it leaves
mfaLevelModerator MFA requirement.BothNoWhile the bot is installed, plus 90 days after it leaves
createdAtWhen the server was created.BothNoWhile the bot is installed, plus 90 days after it leaves
joinedAtWhen the bot joined.BothNoWhile the bot is installed, plus 90 days after it leaves
shardShard the server is on.BothNoWhile the bot is installed, plus 90 days after it leaves
channelCountsNumber of channels of each type. Never names.BothNoWhile the bot is installed, plus 90 days after it leaves
roleCountNumber of roles.BothNoWhile the bot is installed, plus 90 days after it leaves
emojiCountNumber of custom emojis.BothNoWhile the bot is installed, plus 90 days after it leaves
stickerCountNumber of stickers.BothNoWhile the bot is installed, plus 90 days after it leaves
botPermissionsThe bot's permission bitfield in the server.BothNoWhile the bot is installed, plus 90 days after it leaves

guild_join

FieldWhat it isModePersonal dataKept
infoServer profile at install.BothNoWhile the bot is installed, plus 90 days after it leaves
detectedAtStartupTrue when the join happened while the bot was offline.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed

guild_update

FieldWhat it isModePersonal dataKept
infoUpdated server profile.BothNoWhile the bot is installed, plus 90 days after it leaves

guild_leave

FieldWhat it isModePersonal dataKept
guildServer ID that removed the bot.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
detectedAtStartupTrue when the removal happened while the bot was offline.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed

guild_availability

FieldWhat it isModePersonal dataKept
guildServer ID affected by a Discord outage.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
availableWhether the server became available or unavailable.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
shardShard the server is on. Not stored.BothNoNot stored; used while processing the batch only

guild_snapshot

FieldWhat it isModePersonal dataKept
shardsShards reporting the snapshot.BothNoNot stored; used while processing the batch only
shardCountTotal shard count, to detect resharding.BothNoNot stored; used while processing the batch only
guildsServer IDs on those shards, diffed to find joins and removals while offline. Held for up to a day while a new shard layout is still reporting.BothNoNot stored; used while processing the batch only

command_registry

FieldWhat it isModePersonal dataKept
commandsRegistered commands (ID, name, type, scope, subcommands) to find unused ones.BothNoWhile the command stays registered

shard_state

FieldWhat it isModePersonal dataKept
shardShard ID.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
stateReady, resumed, reconnecting, disconnected, error or invalidated. discord.js 15 reports ready, resumed and disconnected.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
closeCodeGateway close code.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
replayedEvents replayed on resume.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
unavailableGuildsServers still unavailable when the shard became ready (discord.js 14). Not stored.BothNoNot stored; used while processing the batch only

rest_window

FieldWhat it isModePersonal dataKept
windowMsLength of the aggregation window. Not stored.BothNoNot stored; used while processing the batch only
rowsREST call counts, retries and latency histograms by method, route and status. Routes hold route words only: IDs, invite and template codes, tokens, query strings and any other value are replaced.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
invalid401, 403 and 429 counts toward the invalid-request ban threshold.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only

rate_limit

FieldWhat it isModePersonal dataKept
scopeScope of the rate limit a request was held back for: user, global or shared.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
globalWhether the limit was global.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
routeRoute with route words only, as for REST calls (never the raw path, which can contain tokens).BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
methodHTTP method.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
limitRequest limit for the bucket. Not stored.BothNoNot stored; used while processing the batch only
retryAfterMilliseconds until the request may be retried.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
sublimitTimeoutSub-limit timeout, if any. Not stored.BothNoNot stored; used while processing the batch only

invalid_request_warning

FieldWhat it isModePersonal dataKept
countInvalid requests counted by discord.js in the current window, kept as the `rest.invalid_warning_count` gauge.BothNo30 days as sent (every 30 seconds for process gauges), then deleted
remainingTimeMilliseconds left in the window. Not stored.BothNoNot stored; used while processing the batch only

gauge_window

FieldWhat it isModePersonal dataKept
gaugesProcess and gateway gauges: shard ping and servers, event-loop delay, memory, caches.BothNo30 days as sent (every 30 seconds for process gauges), then deleted

entitlement

FieldWhat it isModePersonal dataKept
actionCreated, updated or deleted.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
skuSKU ID.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
entitlementTypeEntitlement type (purchase, test, subscription and so on).BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
ownerWhether a user or a server owns the entitlement.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
userKeyed hash of the owning user.BothPseudonymousNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
guildOwning server ID.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
startsAtStart time.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
endsAtEnd time.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed

subscription

FieldWhat it isModePersonal dataKept
actionCreated, updated or deleted.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
statusSubscription status.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
skusSKU IDs.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
userKeyed hash of the subscriber.BothPseudonymousNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
periodStartCurrent period start.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed
periodEndCurrent period end.BothNoNo automatic expiry. A user hash in it can no longer be linked to anyone once its salt is destroyed

custom

FieldWhat it isModePersonal dataKept
nameCustom event name passed to `track()`.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
propsProperties passed to `track()`, chosen by the bot owner. The SDK sends at most 2 KB.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only
userKeyed hash of the user, if the bot passes one.BothPseudonymousIn unique-user counts until the salt for its period is destroyed (period end + 7 days); raw rows expire after 35 days (configurable 7–90)
guildServer ID, if the bot passes one.BothNoRaw rows 35 days (configurable 7–90), then aggregate counts only

app_info

FieldWhat it isModePersonal dataKept
nameApplication name.BothNoLatest value only
approximateGuildCountDiscord's approximate server count.BothNo30 days as sent (every 30 seconds for process gauges), then deleted
approximateUserInstallCountDiscord's approximate user-install count.BothNo30 days as sent (every 30 seconds for process gauges), then deleted
approximateUserAuthorizationCountDiscord's approximate user-authorisation count.BothNoLatest value only
dashboardUserIdsThe app owner's or accepted team members' user IDs, kept as they are to check a Discord sign-in to the dashboard. Admin sessions and the admin activity log keep the ID of the team member who signed in.BothYesLatest value only
eventWebhooksStatusWhether Discord webhook events are enabled.BothNoLatest value only
skusSKU IDs, names and types.BothNoLatest value only
sessionStartRemainingIdentify calls left in the current 24-hour window.BothNo30 days as sent (every 30 seconds for process gauges), then deleted
sessionStartTotalIdentify calls allowed per 24 hours.BothNoLatest value only
nodeVersionNode.js version of the bot process.BothNoLatest value only
libVersiondiscord.js version of the bot process.BothNoLatest value only

sdk_health

FieldWhat it isModePersonal dataKept
queueDepthEvents waiting to be sent.BothNoLatest value only
droppedEvents dropped, by priority lane and by reason.BothNoLatest value only
failedFlushesBatches that failed to send.BothNoLatest value only
internalErrorsErrors caught inside the SDK, by name.BothNoLatest value only

interaction

FieldWhat it isModePersonal dataKept
actorWho ran it (raw user ID, optional names). Audit mode only; encrypted at rest.Audit onlyYesEncrypted; 30 days by default, 90 days maximum

message_command

FieldWhat it isModePersonal dataKept
actorWho ran it (raw user ID, optional names). Audit mode only; encrypted at rest.Audit onlyYesEncrypted; 30 days by default, 90 days maximum

actor

FieldWhat it isModePersonal dataKept
userIdDiscord user ID of the person who ran the interaction or message command.Audit onlyYesEncrypted; 30 days by default, 90 days maximum
usernameUsername. Left out with `auditIncludeProfile: false`.Audit onlyYesEncrypted; 30 days by default, 90 days maximum
avatarAvatar hash, to show the profile picture. Left out with `auditIncludeProfile: false`.Audit onlyYesEncrypted; 30 days by default, 90 days maximum
  • Your own database. With an event sink, the collector copies every event it accepts, without the fields marked “Yes” under personal data, and deletes the copies after the sink’s own retention (35 days by default).
  • ClickHouse (preview). With the ClickHouse store, interactions, message commands and custom events are copied there for 35 days, whatever the raw retention setting, and their minute counts for 400 days.
  • Exporters. The Prometheus and OpenTelemetry exporters run inside your bot. They see events before users are hashed, with the user left out, and keep only counts and timings.