Skip to content

fix(observability): lead Sentry issues with the real error, not just the event slug#1636

Merged
JSONbored merged 2 commits into
mainfrom
fix/sentry-rich-error-messages
Jun 28, 2026
Merged

fix(observability): lead Sentry issues with the real error, not just the event slug#1636
JSONbored merged 2 commits into
mainfrom
fix/sentry-rich-error-messages

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Self-host Sentry issues showed only the event slug as the title (e.g. orb_broker_unavailable) with the real failure buried in a "log" context blob — so operators had to open each issue and dig to learn what actually broke. The forwarder logged rich data but didn't surface it.

forwardStructuredLogToSentry now:

  1. Leads the title with the real failure"<event>: <message ?? error>" (e.g. orb_broker_unavailable: The operation was aborted due to timeout) instead of just the slug, so the issue list is self-explanatory.
  2. Indexes filterable tags for the dimensions operators search + group by (repo, installationId, pull, pr, project, kind, deliveryId, …) — present values only.
  3. Fingerprints by event so recurrences of one failure collapse into a single issue instead of fragmenting on the variable detail now in the title.

This pairs with the source-side instrumentation (#1605/#1619/#1625/#1627/#1628): those make failures reach Sentry at error level; this makes each issue legible at a glance (proper message + level + tags), so future problems surface as self-describing Sentry issues instead of something to hunt for.

Scope

Validation

  • git diff --check · actionlint · typecheck
  • test:coverage — new test asserts the detail-led title + tags + fingerprint; existing forwarder tests (event-only title, message-only/fatal, generic fallback, routine-log skip, no-op-when-off) all still pass and cover the title ternary's other arms + the tag-loop's absent branch. Mock scope gains setFingerprint.
  • test:workers · build:mcp · test:mcp-pack · ui:* · npm audit --audit-level=moderate

If any required check was skipped, explain why:

  • No migration/OpenAPI/cf-typegen: forwarder formatting only.

Safety

  • No secrets/wallets/trust-scores exposed — beforeSend (scrubEvent) still redacts secret-keyed fields before any event leaves the box; this only changes the title/tags built from already-logged, non-secret fields (event/message/error/repo/ids).
  • No public GitHub text change · auth/CORS N/A.

Notes

  • Self-host engine code (the forwarder runs under installStructuredLogForwarding); ships on the next engine rebuild.

…the event slug

forwardStructuredLogToSentry titled each issue with only obj.event and buried
the real failure in a 'log' context blob — so operators had to open each issue
to learn what broke. Now:
- title leads with the failure: "<event>: <message ?? error>" (e.g.
  orb_broker_unavailable: The operation was aborted due to timeout)
- index filterable tags for the dimensions operators search/group by (repo,
  installationId, pull, pr, project, kind, deliveryId), present values only
- fingerprint by event so recurrences collapse into one issue instead of
  fragmenting on the variable detail now in the title

Pairs with the source-side instrumentation (#1605/#1619/#1625/#1627/#1628):
those make failures reach Sentry; this makes each issue legible at a glance.
@dosubot dosubot Bot added the size:S label Jun 28, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.53%. Comparing base (758e524) to head (21678cc).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1636   +/-   ##
=======================================
  Coverage   95.53%   95.53%           
=======================================
  Files         204      204           
  Lines       22084    22090    +6     
  Branches     7972     7975    +3     
=======================================
+ Hits        21097    21103    +6     
  Misses        412      412           
  Partials      575      575           
Files with missing lines Coverage Δ
src/selfhost/sentry.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored self-assigned this Jun 28, 2026
@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 28, 2026
@JSONbored
JSONbored merged commit 59492e6 into main Jun 28, 2026
28 of 30 checks passed
@JSONbored
JSONbored deleted the fix/sentry-rich-error-messages branch June 28, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant