fix(observability): name captured errors so Sentry titles describe the failure - #5064
Merged
Conversation
…e failure (#5058) captureError/captureReviewFailure passed the raw error straight to Sentry.captureException, so every issue title read as the generic "Error: ..." (or a caught library exception's own class, e.g. "HttpError: ..."), regardless of what actually failed. Add an optional eventName parameter that renames the captured error before it reaches Sentry, mirroring forwardStructuredLogToSentry's existing "event" naming discipline, and thread a descriptive slug through every call site across the queue backends, the AI-review pipeline, and the agent action executor.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5064 +/- ##
=======================================
Coverage 94.13% 94.13%
=======================================
Files 465 465
Lines 39542 39543 +1
Branches 14431 14431
=======================================
+ Hits 37223 37224 +1
Misses 1664 1664
Partials 655 655
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
captureError/captureReviewFailure(src/selfhost/sentry.ts) passed the raw error straight toSentry.captureException, so every issue title in Sentry read as the generic "Error: ..." — or, for a genuinely caught library exception, that exception's own class name (e.g. "HttpError: ..."). This made the issue list nearly useless for triage: dozens of unrelated failure modes all collapsed into a handful of "Error"/"HttpError" buckets.eventNameparameter to both functions via a smallnamedCaptureErrorhelper that renames the captured error before it reaches Sentry — mirroringforwardStructuredLogToSentry's existingerrorEvent.name = eventdiscipline, which already gives structured-log-forwarded issues descriptive titles today.processing_timeout,agent_merge_blocked,ai_review_inconclusive,queue_pump_crashed) through everycaptureError/captureReviewFailurecall site insrc/— 21 total acrossserver.ts, both queue backends (sqlite-queue.ts,pg-queue.ts), the AI-review pipeline (ai-review-orchestration.ts,processors.ts), and the agent action executor.new Error(...)) where a stable category name is more useful for grouping than the exception's own class — e.g. an OctokitHttpErrorfrom a blocked merge — the new name groups every terminal hold under one readable title (agent_merge_blocked) regardless of which HTTP status caused it; the status/reason stays in the message and context either way.Closes #5058
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally; my diff's changed lines add no new branches (each call site only gained a literal 3rd string argument), and the only new logic (namedCaptureError'sif (eventName)branch) is covered by 4 new tests intest/unit/selfhost-sentry.test.ts.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below. (N/A — backend-only change, no visible UI.)Notes
captureError/captureReviewFailurecall sites (agent-action-executor.test.ts,ai-review-advisory.test.ts,queue-2.test.ts,queue-4.test.ts) were updated to expect the new thirdeventNameargument.