feat(error_tracking): wire release + optional enrichment extension#187
Merged
Conversation
Two small additions to ``init_sentry`` / ``init_error_tracker``: 1. Pass ``release=VCON_SERVER_GIT_COMMIT`` to ``sentry_sdk.init``. The build commit is already baked into the Docker image; surfacing it on every Sentry event lets a regression be tied back to a specific deploy. 2. After OSS init, opportunistically import an ``error_tracking_ext`` module and call its ``enrich()`` function. Lets a deployment attach process-wide Sentry tags / context without forking this file. The import is wrapped in ``try/except ImportError`` so the module is optional, and the call is wrapped in ``try/except Exception`` so a broken enrichment can never abort startup — it logs and continues. Tests cover release wiring (present + absent commit), the hook present, the hook absent, and a hook that raises. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3ea04e2 to
0ad18e8
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.
What
Two additions to
init_error_tracker:release=VCON_SERVER_GIT_COMMITtosentry_sdk.initso each Sentry event is tied to a specific build. Unset env →release=None(Sentry treats it as optional).init_sentry, opportunistically importerror_tracking_extand call itsenrich()if present. Lets a deployment attach extra Sentry tags / context without forking this file.Safety
error_tracking_extmodule is the default; no warning.enrich()is caught and logged; startup continues.Tests
common/tests/lib/test_error_tracking.py— 8/8 pass.🤖 Generated with Claude Code