feat(observability): auto-wire SENTRY_DSN + VITE_SENTRY_DSN from GlitchTip - #56
Merged
Conversation
…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.
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
dev.sh up -d(dev stack only) now runsscripts/glitchtip-fetch-dsn.shin the background after compose comes up.glitchtip-web, pulls the DSNs for the auto-createdAPI/Frontendprojects viamanage.py shell(no API auth dance — straight to the Django ORM), writes them intocompose/.env, and recreatesapi-dev+ui-devso the new env values land.docker-compose.yml: pipesSENTRY_DSNtoapi-devandVITE_SENTRY_DSNtoui-dev— neither was previously plumbed.compose/.env.example,infra/compose/docs/glitchtip.md, and the docs siteerror-tracking.mdxdrop 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/docsbuilds (67 pages clean)compose/.envapi-devlogs showsentry.initializedwith the resolved DSN andtracesSampleRate: 0from PR fix(observability): OTel is the only tracer; Sentry stays error-only #55shellcheckclean on the new script + the dev.sh delta