FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Route handled error reports through a single Observability::Errors.report API by stephenliang · Pull Request #74801 · code-dot-org/code-dot-org · GitHub

Route handled error reports through a single Observability::Errors.report API - #74801

Draft
stephenliang wants to merge 1 commit into
stagingfrom
stephen/observability-errors-report
Draft

Route handled error reports through a single Observability::Errors.report API#74801
stephenliang wants to merge 1 commit into
stagingfrom
stephen/observability-errors-report

Conversation

Copy link
Copy Markdown
Member

Handled errors were reported with Honeybadger.notify at ~80 call sites, so they never reach Sentry; this PR replaces them with one API, Observability::Errors.report, which forwards to Honeybadger verbatim and mirrors to Sentry, leaving each vendor with exactly two ingestion paths.

flowchart LR
    U[Unhandled exception] --> HM[Honeybadger middleware] & SM[sentry-rails middleware]
    C["Handled rescue: Observability::Errors.report(...)"] --> HB["Honeybadger.notify (args verbatim)"] & S["Sentry capture_exception / capture_message"]
Loading

Call sites change shape only in the method name; all Honeybadger-specific options pass through unchanged:

# before
rescue => exception
  Honeybadger.notify(exception, context: {message: "No code sample found in S3 with with args: #{s3_args}"})

# after
rescue => exception
  Observability::Errors.report(exception, context: {message: "No code sample found in S3 with with args: #{s3_args}"})

observability/errors.rb is now requirable without Rails, so the 13 call sites in root lib/ (DCDO adapters, buffer, image moderation, etc.) use the same API as dashboard code. 79 of 80 Honeybadger.notify sites are converted; the one skip is notify_cronjob_error's internal call, which reports to a different Honeybadger project. The 7 previously Sentry-only Observability::Errors.capture_* sites migrate to report and therefore now also report to Honeybadger.

Links

  • Jira: N/A

Testing story

  • Observability engine suite: 27 runs, 0 failures, including new unit tests for the exception, string, and options-only shapes, verbatim kwarg pass-through, and vendor-absent no-ops.
  • 11 non-Rails lib/test suites pass with their pre-existing Honeybadger.expects(:notify).once.with(...) assertions unchanged, demonstrating the Honeybadger call is byte-equivalent at converted sites.
  • Standalone proof without Rails loaded: bundle exec ruby -e "require './deployment'; require 'observability/errors'; ..." exercises all three call shapes and a real DCDO adapter rescue path (Rails remains undefined).
  • Targeted dashboard suites over all converted files pass; every residual failure reproduces byte-identically with the change stashed (unbuilt asset pipeline in the worktree, known omniauth LTI failures).
  • Rubocop clean on all 68 touched files.

Deployment notes

  • Sentry issue volume will be noisy at first: ~25 message-style sites interpolate runtime values and capture_message groups on text. Fingerprinting is a follow-up.
  • Watch Honeybadger volume on the 7 newly dual-reporting paths (notably the Delayed Job deadlock rescue and the EC2 pricing-client rescue).
  • Post-deploy check: confirm one handled report appears in Sentry (the wrapper's Sentry branch is unit-tested only; no test environment runs with Sentry enabled).

Privacy and security

Context hashes previously sent only to Honeybadger are now mirrored to Sentry as extra data. Sentry remains configured with send_default_pii = false; no new data is collected, but existing report contexts gain a second destination.

🤖 Generated with Claude Code

…led errors

Handled-error reports were Honeybadger-only (~80 Honeybadger.notify call sites), so they never appear in Sentry. Replace them with one API, Observability::Errors.report, that forwards to Honeybadger verbatim and mirrors to Sentry, and works in non-Rails processes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL