Skip to content

Move logger handlers to opentelemetry-instrumentation-logging#4210

Open
xrmx wants to merge 23 commits intoopen-telemetry:mainfrom
xrmx:move-logger-handlers-to-autoinstrumentation
Open

Move logger handlers to opentelemetry-instrumentation-logging#4210
xrmx wants to merge 23 commits intoopen-telemetry:mainfrom
xrmx:move-logger-handlers-to-autoinstrumentation

Conversation

@xrmx
Copy link
Contributor

@xrmx xrmx commented Feb 17, 2026

Description

PR for sketching LoggingHandler move outside of sdk.

Refs open-telemetry/opentelemetry-python#4330
Fixes open-telemetry/opentelemetry-python#4316

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

  • tox

Does This PR Require a Core Repo Change?

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
  • Documentation has been updated

Copy link
Member

@pmcollins pmcollins left a comment

Choose a reason for hiding this comment

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

Looks nice -- added a couple of questions.

@xrmx xrmx changed the title Move logger handlers to autoinstrumentation Move logger handlers to opentelemetry-instrumentation-logging Feb 20, 2026
@xrmx xrmx force-pushed the move-logger-handlers-to-autoinstrumentation branch from 1002797 to 267f85b Compare February 23, 2026 15:49
@xrmx xrmx marked this pull request as ready for review February 23, 2026 15:49
@xrmx
Copy link
Contributor Author

xrmx commented Feb 23, 2026

Added tests, fixed leaks and a wrong test in the copied sdk tests 😓 Added the removal of the handler on uninstrument() if it was instrumented.

@xrmx xrmx requested a review from pmcollins February 23, 2026 15:52
@xrmx xrmx requested a review from a team as a code owner February 24, 2026 10:35
@xrmx
Copy link
Contributor Author

xrmx commented Feb 25, 2026

Genai examples updated in #4263

thread.start()


_STD_TO_OTEL = {
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we reference this piece of code from here

Copy link
Contributor Author

@xrmx xrmx Feb 27, 2026

Choose a reason for hiding this comment

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

The instrumentations does not have a dependency on the sdk and that code in the sdk will be removed in the future. Likely we are going to move some of this code into another package if this is going to be shared by handlers for other log libraries.

thread.start()


_STD_TO_OTEL = {
Copy link
Contributor Author

@xrmx xrmx Feb 27, 2026

Choose a reason for hiding this comment

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

The instrumentations does not have a dependency on the sdk and that code in the sdk will be removed in the future. Likely we are going to move some of this code into another package if this is going to be shared by handlers for other log libraries.

…telemetry/instrumentation/logging/constants.py
Copy link
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Thanks for all the adjustments. Lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Logs SDK: Logging Handler bridge populates unstable code attributes

5 participants