Skip to content

opentelemetry-sdk: deprecate logging handler#4919

Open
xrmx wants to merge 11 commits intoopen-telemetry:mainfrom
xrmx:rework-logging-handler
Open

opentelemetry-sdk: deprecate logging handler#4919
xrmx wants to merge 11 commits intoopen-telemetry:mainfrom
xrmx:rework-logging-handler

Conversation

@xrmx
Copy link
Contributor

@xrmx xrmx commented Feb 17, 2026

Description

Deprecate using the SDK logging handler, suggest to use opentelemetry-instrumentation-logging instead. While at it also fix tests leaking handlers in loggers that affected other tests.

Refs #4330

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

  • Test A

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

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

@xrmx
Copy link
Contributor Author

xrmx commented Feb 19, 2026

Tests are failing because I'm using warnings.deprecated that is not available in older Python versions.

@xrmx xrmx force-pushed the rework-logging-handler branch from a2fed31 to 4139bf5 Compare February 23, 2026 16:16
@xrmx xrmx marked this pull request as ready for review February 23, 2026 16:19
@xrmx xrmx requested a review from a team as a code owner February 23, 2026 16:19
@tammy-baylis-swi tammy-baylis-swi moved this to Ready for review in @xrmx's Python PR digest Feb 23, 2026
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.

Hi Riccardo, changes LGTM. Suggested a couple of grammar tweaks in the warnings.

Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

LGTM. @xrmx we need to update examples in both repos and in opentelemetry.io right?

Also, in a quick search in Github, I found some users of std_to_otel method. Should we add the warning note there?

@emdneto emdneto changed the title opentelemetry-sdk: depcreate logging handler opentelemetry-sdk: deprecate logging handler Feb 24, 2026
@xrmx
Copy link
Contributor Author

xrmx commented Feb 24, 2026

LGTM. @xrmx we need to update examples in both repos and in opentelemetry.io right?

Yes, will update examples, we can update opentelemetry.io only after the release though.

Also, in a quick search in Github, I found some users of std_to_otel method. Should we add the warning note there?

Yeah, we have already moved that in the past #4715, this will go when we drop all the _logs module so there would be bigger breakages I guess 😅

xrmx added 9 commits February 24, 2026 10:59
Move config handling to opentelemetry-instrumentation and the handler to
opentelemetry-instrumentation-logging
While at it also fix the noopprovider test case that was working because
we were asserting against another handler.
@xrmx xrmx force-pushed the rework-logging-handler branch from 10e8b17 to 98356fd Compare February 24, 2026 10:00
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.

This one lgtm 👍

@tammy-baylis-swi tammy-baylis-swi moved this from Ready for review to Approved PRs in @xrmx's Python PR digest Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

4 participants