Skip to content

feat(observability): auto-wire SENTRY_DSN + VITE_SENTRY_DSN from GlitchTip - #56

Merged
agjs merged 1 commit into
mainfrom
feat/auto-wire-glitchtip-dsn
May 29, 2026
Merged

feat(observability): auto-wire SENTRY_DSN + VITE_SENTRY_DSN from GlitchTip#56
agjs merged 1 commit into
mainfrom
feat/auto-wire-glitchtip-dsn

Conversation

@agjs

@agjs agjs commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • dev.sh up -d (dev stack only) now runs scripts/glitchtip-fetch-dsn.sh in the background after compose comes up.
  • The script waits for glitchtip-web, pulls the DSNs for the auto-created API / Frontend projects via manage.py shell (no API auth dance — straight to the Django ORM), writes them into compose/.env, and recreates api-dev + ui-dev so the new env values land.
  • Idempotent: only writes when the env value is empty — a pre-set value (hosted Sentry, external GlitchTip) is treated as deliberate operator intent and left alone.
  • docker-compose.yml: pipes SENTRY_DSN to api-dev and VITE_SENTRY_DSN to ui-dev — neither was previously plumbed.
  • Docs catch up: compose/.env.example, infra/compose/docs/glitchtip.md, and the docs site error-tracking.mdx drop the manual paste step and the misleading "wire your own Sentry.init" snippet.

Removes the manual "open GlitchTip, copy DSN, paste into env, restart" ritual from hour one. Sentry init no-ops on empty DSN, so a partial or failed wire still leaves the stack bootable — same failure mode as before, but the happy path is now free.

Test plan

  • apps/docs builds (67 pages clean)
  • Local end-to-end on the dev stack:
  • Pre-push smoke gate green
  • shellcheck clean on the new script + the dev.sh delta

…chTip

`dev.sh up -d` on the dev stack now spawns scripts/glitchtip-fetch-dsn.sh
in the background. The script waits for glitchtip-web to be ready, pulls
the DSN for the auto-created API and Frontend projects via manage.py
shell (no API auth dance — straight to the Django ORM), writes them to
compose/.env, and recreates api-dev + ui-dev so the new env values land
in the running containers.

Idempotent: only writes when the .env value is empty. A non-empty
existing value is treated as deliberate operator intent (hosted Sentry,
external GlitchTip) and left alone. To re-wire after a Postgres volume
wipe, clear the two lines in compose/.env and re-run the script.

Removes the manual "open GlitchTip, copy DSN, paste into env, restart"
ritual from first boot. Sentry init no-ops on empty DSN, so a partial
or failed wire still leaves the stack bootable — the failure mode is
"errors don't ship", same as before.

Other touches:
- docker-compose.yml api-dev gets SENTRY_DSN env passthrough; ui-dev
  gets VITE_SENTRY_DSN — neither was previously plumbed from
  compose/.env.
- compose/.env.example documents both vars and the auto-wire behaviour.
- infra/compose/docs/glitchtip.md and the docs site error-tracking page
  drop the manual paste step; the SDK integration section now reflects
  that init is already wired in the templates (not a snippet the
  operator copies in).
- Script uses Docker label filters (project + service) rather than
  `docker compose ps -q` because glitchtip-web is defined in the
  overlay, not the base docker-compose.yml — label lookup is
  overlay-agnostic and project-scoped.
@agjs
agjs enabled auto-merge (squash) May 29, 2026 17:19
@agjs
agjs merged commit a4ad0b9 into main May 29, 2026
24 checks passed
@agjs
agjs deleted the feat/auto-wire-glitchtip-dsn branch May 29, 2026 17:22
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.

1 participant