Sentry Setup Checklist¶
Sentry config lives in two completely separate places. They do not share values:
- GitHub repo secrets — only available to the CI release workflow
(
.github/workflows/sentry_release.yml). Used at build/release time. - App Runner runtime env vars — available to the running Node process. Used at runtime.
A value set in GitHub secrets is invisible to App Runner, and vice-versa.
1. GitHub repo secrets (build / release time)¶
Settings → Secrets and variables → Actions → New repository secret.
| Name | Value | Used by |
|---|---|---|
SENTRY_AUTH_TOKEN |
Sentry org auth token (create at Sentry → Settings → Auth Tokens) | getsentry/action-release to upload source maps |
SENTRY_ORG |
studiojadu |
release action |
SENTRY_PROJECT |
studio-backend |
release action |
These should already exist (used by other workflows); confirm they are present:
| Name | Purpose |
|---|---|
SCENARIX_GITHUB_PKG_TOKEN |
npm ci against the private GitHub registry |
AUTO_PR_BOT_APP_PRIVATE_KEY (secret) + AUTO_PR_BOT_APP_ID (variable) |
GitHub App token for the version-bump push (main is branch-protected) |
Do not put
SENTRY_DSNorSENTRY_ENVIRONMENThere — the running app never reads GitHub secrets.
2. App Runner runtime env vars (runtime)¶
Set per service in the App Runner console → Configuration → Environment variables.
Region us-east-1, account 408921634255.
studio-backend-prod (branch main)¶
| Name | Value |
|---|---|
SENTRY_DSN |
<dsn> |
SENTRY_ENVIRONMENT |
production |
studio-backend-staging (branch staging)¶
| Name | Value |
|---|---|
SENTRY_DSN |
<dsn> |
SENTRY_ENVIRONMENT |
staging |
DSN (org studiojadu, project studio-backend):
https://4639b857b48387a7883f56af5da85211@o4511307846713344.ingest.us.sentry.io/4511607481630720
The DSN is safe to expose — it can only send events, not read them. It is not a credential, so it lives in App Runner config rather than as a secret.
Why the split matters¶
instrument.tsreadsprocess.env.SENTRY_DSNandprocess.env.SENTRY_ENVIRONMENTat startup. IfSENTRY_DSNis unset, Sentry init is skipped entirely and the app reports nothing. So the DSN + environment must be App Runner env vars — putting them only in GitHub secrets leaves Sentry disabled in prod/staging.SENTRY_AUTH_TOKENis a real credential and is only needed by CI to upload source maps. It must never ship to the running app.SENTRY_RELEASEis not needed anywhere: the app self-reports its release frompackage.jsonversion, and the CI workflow uploads source maps under that same bumped version. (It remains available as an optional override env var.)
How the release flow ties together¶
- Push lands on
main→sentry_release.ymlruns. - Workflow bumps
package.jsonpatch version, commits[skip ci], pushes (via GitHub App token, since main is branch-protected). - App Runner auto-deploys that exact commit. At startup the app reports
release = <package.json version>. getsentry/action-release@v3injects debug IDs into./distand uploads the source maps under the same version → stack traces in Sentry resolve tosrc/*.ts, tagged with the correct environment and release.
Verify after configuring¶
- Confirm both App Runner services have
SENTRY_DSN+SENTRY_ENVIRONMENTset and have redeployed. - Hit
/api/debug-sentry/error(requiresENABLE_TEST_ROUTES=true) on a deployed service. - In Sentry, confirm the issue appears tagged
environment: staging|production,release: <version>, with asrc/*.tsstack trace (notdist/*.js).