Skip to content

Add Sentry error reporting to control plane and worker#179

Merged
motatoes merged 1 commit intomainfrom
add-sentry-control-plane-worker
Apr 21, 2026
Merged

Add Sentry error reporting to control plane and worker#179
motatoes merged 1 commit intomainfrom
add-sentry-control-plane-worker

Conversation

@motatoes
Copy link
Copy Markdown
Contributor

Summary

  • New shared internal/observability package that initializes the Sentry Go SDK and registers a panic recover. Both are no-ops when OPENSANDBOX_SENTRY_DSN is unset, so existing deployments are unaffected until the DSN is set.
  • cmd/server and cmd/worker call observability.Init(...) at startup, defer the flush, and defer observability.Recover() so panics are captured before the process dies.
  • 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.
  • New config fields: OPENSANDBOX_SENTRY_DSN, OPENSANDBOX_SENTRY_ENVIRONMENT (defaults to OPENSANDBOX_REGION), OPENSANDBOX_SENTRY_SAMPLE_RATE (default 1.0), OPENSANDBOX_SENTRY_TRACES_SAMPLE_RATE (default 0.0 — tracing off).
  • deploy/{server,worker}.env.example updated to document the env vars and the server-sentry-dsn / worker-sentry-dsn Key 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/observability passes
  • go vet ./... clean on touched packages
  • Start control plane locally with OPENSANDBOX_SENTRY_DSN unset — log line sentry: enabled is absent, no new behavior
  • Start control plane locally with the DSN set — log line appears; trigger a panic and confirm the event shows up in Sentry with service=control-plane tag
  • Same two checks for the worker — confirm service=worker tag on the event
  • Add server-sentry-dsn / worker-sentry-dsn to Azure Key Vault before merging to prod

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensandbox Ready Ready Preview, Comment Apr 21, 2026 7:15pm

Request Review

Copy link
Copy Markdown
Contributor

@breardon2011 breardon2011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve

@motatoes motatoes merged commit 47d2e69 into main Apr 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants