Add Sentry error reporting to control plane and worker#179
Merged
Conversation
Wire the Sentry Go SDK into cmd/server and cmd/worker via a shared internal/observability package. Init is a no-op when OPENSANDBOX_SENTRY_DSN is unset, so existing deployments without the env var are unaffected. Events are tagged with service (control-plane|worker), region, worker_id, and mode. Release is fed from the existing WorkerVersion ldflag on the worker and a new ServerVersion ldflag on the control plane. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Apr 21, 2026
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.
Summary
internal/observabilitypackage that initializes the Sentry Go SDK and registers a panic recover. Both are no-ops whenOPENSANDBOX_SENTRY_DSNis unset, so existing deployments are unaffected until the DSN is set.cmd/serverandcmd/workercallobservability.Init(...)at startup,deferthe flush, anddefer observability.Recover()so panics are captured before the process dies.service(control-plane|worker),region,worker_id, andmode. Release is fed from the existingWorkerVersionldflag on the worker and a newServerVersionldflag on the control plane.OPENSANDBOX_SENTRY_DSN,OPENSANDBOX_SENTRY_ENVIRONMENT(defaults toOPENSANDBOX_REGION),OPENSANDBOX_SENTRY_SAMPLE_RATE(default1.0),OPENSANDBOX_SENTRY_TRACES_SAMPLE_RATE(default0.0— tracing off).deploy/{server,worker}.env.exampleupdated to document the env vars and theserver-sentry-dsn/worker-sentry-dsnKey Vault secret names.Out of scope for this PR (deferred): oc CLI and the TS / Python SDKs.
Test plan
go build ./cmd/server ./cmd/worker ./internal/observabilitypassesgo vet ./...clean on touched packagesOPENSANDBOX_SENTRY_DSNunset — log linesentry: enabledis absent, no new behaviorservice=control-planetagservice=workertag on the eventserver-sentry-dsn/worker-sentry-dsnto Azure Key Vault before merging to prod🤖 Generated with Claude Code