feat(discovery-index): instrument with Sentry error tracking and release/sourcemap upload#7932
Merged
Merged
Conversation
…ase/sourcemap upload (#4934) Reports route/process-level errors into the shared metagraphed Sentry project (same one the rest of the infra already flows into), with secret-field and secret-value redaction before anything leaves the process. Source maps and release/deploy tracking run via upload-sourcemaps.ts at container startup, so SENTRY_AUTH_TOKEN stays a runtime-only secret, never baked into an image layer.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7932 +/- ##
==========================================
+ Coverage 91.77% 91.79% +0.01%
==========================================
Files 731 733 +2
Lines 74878 75056 +178
Branches 22845 22902 +57
==========================================
+ Hits 68717 68895 +178
Misses 5083 5083
Partials 1078 1078
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
metagraphedSentry project (jsonboredorg) — the same project this repo's other hosted infra already flows into (part of Stand up centrally-owned observability for a hosted fleet #4934's centrally-owned observability initiative).upload-sourcemaps.tsruns as the first step of the container's runtimeCMD(not baked into the Docker image, sinceSENTRY_AUTH_TOKENis a runtime-only secret) — creates the release, associates commits, uploads/validates source maps, records the deploy, and finalizes, before deleting the uploaded.mapfiles and starting the server. Mirrorsreview-enrichment/src/upload-sourcemaps.ts's design.src/sentry.ts).SENTRY_DSN,SENTRY_ORG,SENTRY_PROJECT,SENTRY_ENVIRONMENT) and theSENTRY_AUTH_TOKENsecret are optional — every piece no-ops cleanly with a log line when unset, never blocking the boot.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md.Validation
git diff --checknpm run typechecknpm run test:coveragelocally —sentry.tsandupload-sourcemaps.tsboth at 100% line/branch coverage; full unsharded run: 1057 files / 20019 tests passing, no regressions.npm run build:mcp/npm run build:minernpm run cf:typecheck(Workers-runtime typecheck forworker.ts/rate-limiter.ts)npm audit --audit-level=moderate— pre-existing ambient advisories only (transitive via@modelcontextprotocol/sdk/agents, unrelated to this PR's@sentry/cli/@sentry/nodeadditions);audit.ymldocuments this as a scheduled, non-blocking check, not a per-PR gate.upload-sourcemapscorrectly no-ops without real Sentry secrets, server starts,/healthresponds.wrangler deploy --dry-runconfirms the new Sentry vars/bindings resolve correctly.Safety
SENTRY_DSN/SENTRY_ORG/SENTRY_PROJECTare non-sensitive (write-only ingest URL + slugs, safe as plainwrangler.jsoncvars);SENTRY_AUTH_TOKENstays awrangler secret, never committed.Notes
Follow-up infra work on top of #7167/#4250 (discovery-index Cloudflare Container deployment). GitHub Actions build integration for automatic deploys is a separate, maintainer-side follow-up.