Skip to content

New package: unhandled Exceptions logging instrumentation#4503

Merged
xrmx merged 41 commits into
open-telemetry:mainfrom
iblancasa:4209
Jun 22, 2026
Merged

New package: unhandled Exceptions logging instrumentation#4503
xrmx merged 41 commits into
open-telemetry:mainfrom
iblancasa:4209

Conversation

@iblancasa

Copy link
Copy Markdown
Contributor

Description

This PR adds a new opentelemetry-instrumentation-exceptions package which allows capturing unhandled exceptions.

Fixes #4209

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Unit tests
  • Manual test with a hello world

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
@xrmx xrmx moved this to Ready for review in Python PR digest May 4, 2026
iblancasa added 6 commits May 4, 2026 10:43
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
@github-project-automation github-project-automation Bot moved this from Ready for review to Reviewed PRs that need fixes in Python PR digest May 5, 2026
iblancasa added 3 commits May 5, 2026 09:34
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
@iblancasa

Copy link
Copy Markdown
Contributor Author

Thank you @herin049 for the feedback.

@iblancasa iblancasa requested a review from herin049 May 5, 2026 07:44
@emdneto

emdneto commented May 12, 2026

Copy link
Copy Markdown
Member

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

@iblancasa

Copy link
Copy Markdown
Contributor Author

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Didn't know about that. Fixing... thank you!

@github-actions github-actions Bot added the gen-ai Related to generative AI label Jun 17, 2026
@xrmx

xrmx commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@herin049 Could you please take another look? Thanks!

@xrmx xrmx moved this from Reviewed PRs that need fixes to Approved PRs in Python PR digest Jun 17, 2026
@herin049 herin049 requested a review from Copilot June 17, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-exceptions package (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.

Comment thread instrumentation/opentelemetry-instrumentation-exceptions/LICENSE Outdated
@xrmx xrmx moved this from Approved PRs to Reviewed PRs that need fixes in Python PR digest Jun 18, 2026
@xrmx xrmx moved this from Reviewed PRs that need fixes to Approved PRs that need fixes in Python PR digest Jun 18, 2026
@xrmx xrmx added this pull request to the merge queue Jun 22, 2026
Merged via the queue into open-telemetry:main with commit 00d58ac Jun 22, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for merge to Done in Python PR digest Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gen-ai Related to generative AI

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

New package: unhandled Exceptions logging instrumentation

6 participants