Repository navigation
Enable Sentry tracing, profiling, sessions and runtime metrics - #69
Merged
Merged
Conversation
Turn traces on at sample rate 1 (SENTRY_TRACES_SAMPLE_RATE) so a long-running Discord bot gets command spans, outbound HTTP traces, process sessions and Node runtime metrics. Health probes stay off the trace and session counts. Errors remain unsampled. Missing DSN still leaves Sentry off.
@sentry/profiling-node (pinned to 11.2.0 with @sentry/node) profiles command spans in trace lifecycle. Default session sample rate is 1; SENTRY_PROFILE_SESSION_SAMPLE_RATE=0 leaves the native integration off.
NinjaLikesCheez
marked this pull request as ready for review
October 8, 2026 19:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turn Pixel’s Sentry setup from “errors and logs only” into something useful for a long-running Node Discord bot.
Enabled (when
SENTRY_DSNis set):sampleRate1 (always keep errors; this was already the SDK default, now explicit)tracesSampleRate1 by default — acommandspan per slash command / autocomplete, plus outbound HTTP (SpaceAPI, Home Assistant, Discord REST)@sentry/profiling-node(pinned to 11.2.0 to match@sentry/node) withprofileLifecycle: "trace"so sampled command spans get a CPU profile. Native install script is allowed inpnpm-workspace.yaml(@sentry/node-cpu-profiler); prebuilt binaries cover Node 24 on glibc (the Docker image)./healthzand/readyzprobes do not count as sessionspixel.commandcount on each commandHealth probes are not traced. Missing DSN still leaves Sentry off. Secrets (
SENTRY_DSN, tokens) are still not logged. Auth, identity and the dispatcher’s access checks are untouched.New env vars:
SENTRY_TRACES_SAMPLE_RATE(0–1, default1)SENTRY_PROFILE_SESSION_SAMPLE_RATE(0–1, default1;0leaves the profiler unwired)Documented in
config.ts,.env.example, the architecture config table, and the runbook.Does not touch
core/access*,core/identity*,core/dispatcher*,core/registry*orservices/access-config*.Why a new dependency: Sentry’s Node CPU profiler is a separate native package. It is the only way to get profiles on command traces. The version is pinned to 11.2.0 so it stays on the same SDK line as
@sentry/node.