Sentry — Operations Workbook

Service: sentry (SaaS — sentry.io) Account: radieu@gmail.com Compliance: dev_r_services.service_name = 'sentry'


1. What Sentry does in this ecosystem

Sentry provides two distinct functions:

1a. Runtime error capture in et-operational-platform (primary)

@sentry/nextjs is installed in the et-operational-platform Next.js app. It captures:

  • Unhandled JS exceptions in the browser
  • Server-side API route errors
  • Edge function exceptions

Errors appear in the Sentry dashboard at sentry.io under the et-operational-platform project.

SENTRY_AUTH_TOKEN is required at Vercel build time to upload source maps so Sentry can show readable stack traces instead of minified code. It is configured as a Vercel environment variable in the et-operational-platform project.

1b. Alert routing via n8n (secondary)

An n8n workflow (infra-src/n8n-workflows/sentry-to-github.json) subscribes to Sentry webhook alerts and converts them into GitHub issues in radieu/et-operational-platform. Deduplication is done via sentry-id HTML comment markers in existing issues.

Webhook path: n8n.bms-4.infra.zintegrowana.online/webhook/sentry-alert n8n env vars needed: GH_TOKEN, DISCORD_WEBHOOK_URL


2. Credentials

CredentialPurposeLocations
SENTRY_AUTH_TOKENSource map uploads (Vercel build) + Sentry CLI release tracking.env.local · GH Secret SENTRY_AUTH_TOKEN · Vercel env vars (et-operational-platform)

SENTRY_AUTH_TOKEN is a CI/CD credential stored directly as a GH Secret. Infisical CE was decommissioned 2026-06-21.

Token scopes required

When generating a new token at sentry.io → User Settings → Auth Tokens:

  • project:releases — create releases, upload source maps
  • org:read — org-level operations

3. Token rotation procedure

Rotation frequency: 90 days
Last rotated: 2026-05-08
Next due: 2026-08-06

[ ] 1. Go to sentry.io → User Settings → Auth Tokens → Generate new token
        Scopes: project:releases, org:read
[ ] 2. Update GH Secret:
        Write-Output <new-token> | gh secret set SENTRY_AUTH_TOKEN --repo radieu/p24-infra
[ ] 3. Update .env.local: SENTRY_AUTH_TOKEN=<new-token>
[ ] 4. Update Vercel env var in et-operational-platform project
[ ] 5. Verify GH Secret `SENTRY_AUTH_TOKEN` is updated in radieu/p24-infra settings
[ ] 6. Verify next Vercel deployment succeeds (source maps upload in build log)
[ ] 7. Revoke old token in Sentry
[ ] 8. Append to docs/secrets-rotation-log.md:
        | YYYY-MM-DD | SENTRY_AUTH_TOKEN | scheduled | radieu | yes — GH Secret + .env.local + Vercel |

4. Verifying Sentry is working

Check source map uploads (after deployment)

In Vercel deployment logs, look for lines like:

[sentry] Uploaded source maps for release <git-sha>

Check error capture

In Sentry dashboard → et-operational-platform project → Issues. Trigger a test error in the app and confirm it appears within ~30s.

Check n8n webhook

# Trigger a test ping from Sentry
# Sentry → Project Settings → Integrations → Webhooks → Send Test Notification
# Verify a GitHub issue is created in radieu/et-operational-platform

5. Known issues

  • Source maps: If SENTRY_AUTH_TOKEN expires or is missing from Vercel env vars, stack traces in Sentry will show minified code. Errors are still captured — just harder to read.
  • n8n deduplication: If the sentry-id comment marker is removed from an issue body, duplicate issues may be created for the same Sentry event.