Skip to content

feat(error_tracking): wire release + optional enrichment extension#187

Merged
pavanputhra merged 1 commit into
mainfrom
sentry-release-and-extension-hook
May 27, 2026
Merged

feat(error_tracking): wire release + optional enrichment extension#187
pavanputhra merged 1 commit into
mainfrom
sentry-release-and-extension-hook

Conversation

@pavanputhra
Copy link
Copy Markdown
Contributor

@pavanputhra pavanputhra commented May 27, 2026

What

Two additions to init_error_tracker:

  1. Pass release=VCON_SERVER_GIT_COMMIT to sentry_sdk.init so each Sentry event is tied to a specific build. Unset env → release=None (Sentry treats it as optional).
  2. After init_sentry, opportunistically import error_tracking_ext and call its enrich() if present. Lets a deployment attach extra Sentry tags / context without forking this file.

Safety

  • A missing error_tracking_ext module is the default; no warning.
  • An exception inside enrich() is caught and logged; startup continues.

Tests

common/tests/lib/test_error_tracking.py — 8/8 pass.

🤖 Generated with Claude Code

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>
@pavanputhra pavanputhra force-pushed the sentry-release-and-extension-hook branch from 3ea04e2 to 0ad18e8 Compare May 27, 2026 17:44
@pavanputhra pavanputhra merged commit b63fe80 into main May 27, 2026
1 check passed
@pavanputhra pavanputhra deleted the sentry-release-and-extension-hook branch May 27, 2026 17:54
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