New package: unhandled Exceptions logging instrumentation#4503
Conversation
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
…-contrib into 4209
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
|
Thank you @herin049 for the feedback. |
…-contrib into 4209
|
Thanks for the PR! Just a heads-up: we no longer update Please add the appropriate changelog fragment for this change instead of editing |
Didn't know about that. Fixing... thank you! |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
|
@herin049 Could you please take another look? Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new contrib instrumentation package, opentelemetry-instrumentation-exceptions, to capture uncaught process exceptions, uncaught thread exceptions, and unhandled asyncio task exceptions and emit them as OpenTelemetry Logs (plus wiring it into the repo’s packaging, docs, and CI/test matrix).
Changes:
- Added the new
opentelemetry-instrumentation-exceptionspackage (instrumentor implementation + tests). - Integrated the package into bootstrap defaults, the contrib meta-package, documentation, changelog, and component ownership.
- Added tox environments and GitHub Actions jobs for linting and testing across supported Python versions.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds the new package to the workspace lock members and dependency graph. |
| tox.ini | Introduces test/lint tox envs and deps wiring for the new instrumentation package. |
| opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py | Includes the new instrumentation in the default bootstrap instrumentations list. |
| opentelemetry-contrib-instrumentations/pyproject.toml | Adds the new instrumentation to the “contrib instrumentations” aggregate dependency set. |
| instrumentation/README.md | Lists the new instrumentation package in the instrumentation catalog table. |
| instrumentation/opentelemetry-instrumentation-exceptions/tests/test_exceptions.py | Adds unit tests verifying logs are emitted for sys/thread/asyncio unhandled exception hooks. |
| instrumentation/opentelemetry-instrumentation-exceptions/test-requirements.txt | Adds the standard pinned test requirements + editable installs for this package. |
| instrumentation/opentelemetry-instrumentation-exceptions/src/opentelemetry/instrumentation/exceptions/version.py | Defines the package version. |
| instrumentation/opentelemetry-instrumentation-exceptions/src/opentelemetry/instrumentation/exceptions/package.py | Declares instrumentation metadata (_instruments, _supports_metrics). |
| instrumentation/opentelemetry-instrumentation-exceptions/src/opentelemetry/instrumentation/exceptions/init.py | Implements the instrumentor that wraps exception hooks and emits OTel logs. |
| instrumentation/opentelemetry-instrumentation-exceptions/README.rst | Adds package-level README with installation and usage instructions. |
| instrumentation/opentelemetry-instrumentation-exceptions/pyproject.toml | Adds package build metadata, dependencies, and entry point registration. |
| instrumentation/opentelemetry-instrumentation-exceptions/LICENSE | Adds a LICENSE file for the new package. |
| docs/instrumentation/exceptions/exceptions.rst | Adds Sphinx API docs page for the new instrumentation module. |
| .github/workflows/test.yml | Adds CI test jobs for the new package across CPython and PyPy. |
| .github/workflows/lint.yml | Adds CI lint job for the new package. |
| .github/workflows/core_contrib_test.yml | Adds core+contrib integration test job for the new package. |
| .github/component_owners.yml | Registers a component owner for the new package path. |
| .changelog/4503.added | Adds a changelog entry announcing the new instrumentation package. |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Description
This PR adds a new
opentelemetry-instrumentation-exceptionspackage which allows capturing unhandled exceptions.Fixes #4209
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.