Add Bugsnag instrumentation module#230
Open
morgan-wowk wants to merge 1 commit intographite-base/230from
Open
Conversation
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced May 8, 2026
adc82a2 to
d7bdc24
Compare
cf06f0c to
248ce56
Compare
d7bdc24 to
c504f6a
Compare
4a6f0bc to
7a7696e
Compare
7a7696e to
6842b69
Compare
6842b69 to
936d216
Compare
c504f6a to
2cba7e9
Compare
936d216 to
514d0f0
Compare
2cba7e9 to
50ed65a
Compare
514d0f0 to
365eab5
Compare
50ed65a to
af2ab2d
Compare
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.

TL;DR
Adds a Bugsnag error reporting integration that is a no-op when the required environment variables are not set.
What changed?
A new
bugsnaginstrumentation module was introduced with three entry points:setup(service_name)— configures the Bugsnag client using environment variables (TANGLE_BUGSNAG_API_KEY,TANGLE_ENV,TANGLE_SERVICE_VERSION,TANGLE_BUGSNAG_NOTIFY_ENDPOINT,TANGLE_BUGSNAG_SESSIONS_ENDPOINT).notify(exception, **metadata)— reports an exception to Bugsnag with optional extra metadata attached._before_notify(event)— a Bugsnag callback that automatically attaches contextual logging metadata (e.g.request_id,user_id) to every reported event under atangle_contexttab.Both
setupandnotifyare no-ops whenTANGLE_BUGSNAG_API_KEYorTANGLE_ENVare missing. Failures withinsetupandnotifyare caught and logged rather than propagated.How to test?
TANGLE_BUGSNAG_API_KEYandTANGLE_ENVin your environment and callsetup()followed bynotify()with a test exception to verify events appear in Bugsnag.pytest tests/instrumentation/test_bugsnag.pyWhy make this change?
To provide structured, centralized error reporting to Bugsnag across backend services, with automatic enrichment from contextual logging metadata and safe fallback behaviour when Bugsnag is not configured.