GlitchTip Monitoring Setup
Section titled “GlitchTip Monitoring Setup”GlitchTip is Sentry-compatible, so this repo uses the official Sentry SDKs for minimal error monitoring.
Instrumented apps
Section titled “Instrumented apps”Browser runtimes
Section titled “Browser runtimes”apps/dashboard— TanStack Start + React + Viteapps/marketing— Astro + Vite
Cloudflare/server runtimes
Section titled “Cloudflare/server runtimes”apps/dashboard— Cloudflare Worker SSR/server functionsworkers/consumer-api— Hono Cloudflare Workerworkers/ingestion-orchestrator— ingress queue + ORCID sync control planeworkers/ingestion-process— heavy ORCID/OpenAlex/Crossref processing pipelineworkers/notification— email and Discord notification deliveryworkers/person-query— people query serviceworkers/person-write— people write serviceworkers/publication-query— publications query serviceworkers/publication-write— publications write service
Inspected but intentionally not instrumented in this minimal rollout
Section titled “Inspected but intentionally not instrumented in this minimal rollout”apps/docs— Starlight docs site, mostly staticworkers/rate-limiter— Durable Object helperworkers/log-processor— tail/log processor
Packages added
Section titled “Packages added”@sentry/browser@sentry/cloudflare
Shared helper
Section titled “Shared helper”A small shared monitoring utility lives in:
packages/utils/src/monitoring.ts
It provides:
captureException(error, context?)captureMessage(message, level?, context?)- safe no-op behavior when no DSN is configured
- basic redaction of sensitive fields before events are sent
Files changed
Section titled “Files changed”Shared
Section titled “Shared”packages/utils/src/monitoring.tspackages/utils/src/index.ts
Dashboard app
Section titled “Dashboard app”apps/dashboard/src/lib/monitoring.tsapps/dashboard/src/app/entry-client.tsxapps/dashboard/src/app/entry-server.tsxapps/dashboard/src/server/functions/info.tsapps/dashboard/src/components/feedback/DebugWidget.tsxapps/dashboard/src/vite-env.d.tsapps/dashboard/.env.example
Public site
Section titled “Public site”apps/marketing/src/lib/monitoring.tsapps/marketing/src/layouts/BaseLayout.astro
Workers
Section titled “Workers”workers/consumer-api/src/monitoring.tsworkers/consumer-api/src/index.tsworkers/consumer-api/shared-env.d.tsworkers/ingestion-orchestrator/src/monitoring.tsworkers/ingestion-orchestrator/src/index.tsworkers/ingestion-orchestrator/shared-env.d.tsworkers/ingestion-process/src/monitoring.tsworkers/ingestion-process/src/index.tsworkers/ingestion-process/shared-env.d.tsworkers/notification/src/monitoring.tsworkers/notification/src/index.tsworkers/notification/shared-env.d.ts
Required env vars
Section titled “Required env vars”Dashboard browser (Vite client env)
Section titled “Dashboard browser (Vite client env)”Use the VITE_ prefix:
VITE_SENTRY_DSN=https://<public-key>@errors-monit.legaciti.org/<project-id>VITE_SENTRY_ENVIRONMENT=productionVITE_SENTRY_RELEASE=2026-04-18+<git-sha>Public site browser (Astro public env)
Section titled “Public site browser (Astro public env)”Use the PUBLIC_ prefix:
PUBLIC_SENTRY_DSN=https://<public-key>@errors-monit.legaciti.org/<project-id>PUBLIC_SENTRY_ENVIRONMENT=productionPUBLIC_SENTRY_RELEASE=2026-04-18+<git-sha>Cloudflare Workers / server runtimes
Section titled “Cloudflare Workers / server runtimes”Use Wrangler secrets or vars, with no public prefix:
SENTRY_DSN=https://<public-key>@errors-monit.legaciti.org/<project-id>SENTRY_ENVIRONMENT=productionSENTRY_RELEASE=2026-04-18+<git-sha>SENTRY_TRACES_SAMPLE_RATE=0.05For monitored workers in this repository, SENTRY_ENVIRONMENT is set in wrangler.jsonc for production, and SENTRY_DSN should be provisioned as a Wrangler secret.
SENTRY_TRACES_SAMPLE_RATE must be a value from 0 to 1.
- Missing/empty value: runtime default by environment
- Invalid value (non-numeric or outside
0..1): forced to0
Environment defaults used when SENTRY_TRACES_SAMPLE_RATE is omitted:
development:1.0preview/staging:0.1production:0.05
Suggested rollout strategy:
- Preview:
1.0for short validation windows. - Production initial:
0.02to0.05. - Increase only if event volume and cost are acceptable.
Worker audit and dev setup tooling
Section titled “Worker audit and dev setup tooling”Audit all workers for Sentry wiring
Section titled “Audit all workers for Sentry wiring”node scripts/monitoring/audit-worker-sentry.mjsThis checks all worker folders and reports:
- whether a worker is Sentry-instrumented
- whether
SENTRY_ENVIRONMENTis present in itswrangler.jsonc - whether shared env typings include Sentry fields
Provision GlitchTip dev secrets for all monitored workers
Section titled “Provision GlitchTip dev secrets for all monitored workers”GLITCHTIP_DEV_DSN='https://<key>@<glitchtip-host>/<project-id>' \node scripts/monitoring/setup-glitchtip-dev.mjsOptional overrides:
# Per-worker DSN override (example for worker-person-write)GLITCHTIP_DEV_DSN_WORKER_PERSON_WRITE='https://<key>@<host>/<project-id>'
# Optional knobsGLITCHTIP_DEV_ENVIRONMENT='development'GLITCHTIP_DEV_TRACE_RATE='1.0'CLOUDFLARE_TARGET_ENV='development'The setup script writes, per monitored worker:
SENTRY_DSNSENTRY_ENVIRONMENTSENTRY_TRACES_SAMPLE_RATE
into Wrangler secrets for the selected Cloudflare environment.
Security defaults
Section titled “Security defaults”- No-op when DSN is missing
sendDefaultPii: false- tracing defaults are environment-driven unless overridden by
SENTRY_TRACES_SAMPLE_RATE - request headers, cookies, query strings, and request bodies are stripped before send
- obvious sensitive keys such as
authorization,cookie,token,secret,password, andapi_keyare redacted
How to test
Section titled “How to test”Browser-side test
Section titled “Browser-side test”- Run the dashboard locally or enable the existing debug widget.
- Open the debug widget.
- Click Test Browser Error.
- Confirm the event appears in GlitchTip.
Server-side test
Section titled “Server-side test”- Open the same debug widget in the dashboard.
- Click Test Server Event.
- Confirm the server-side event appears in GlitchTip.
The debug test buttons are intended for development or internal/admin debugging only.
Manual verification alternative
Section titled “Manual verification alternative”If you prefer not to use the debug widget, temporarily add:
throw new Error("GlitchTip manual verification test");to the relevant browser or worker path, confirm the event arrives, then remove it.