Skip to content

Change import path for LoggingHandler to accommodate upstream breaking changes#45516

Merged
rads-1996 merged 18 commits intoAzure:mainfrom
rads-1996:logging-handler
Mar 18, 2026
Merged

Change import path for LoggingHandler to accommodate upstream breaking changes#45516
rads-1996 merged 18 commits intoAzure:mainfrom
rads-1996:logging-handler

Conversation

@rads-1996
Copy link
Member

Description

LoggingHandler from opentelemetry.sdk_logs is being deprecated. Need to use the LoggingHandler from the opentelemetry-instrumentation-logging instead.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

@github-actions github-actions bot added Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter labels Mar 4, 2026
@rads-1996 rads-1996 force-pushed the logging-handler branch 4 times, most recently from 6da3ac7 to 170f2de Compare March 5, 2026 21:37
@rads-1996 rads-1996 changed the title Change import path for LoggingHandler to accomodate upstream breaking changes Change import path for LoggingHandler to accommodate upstream breaking changes Mar 5, 2026
@rads-1996 rads-1996 marked this pull request as ready for review March 6, 2026 00:17
Copilot AI review requested due to automatic review settings March 6, 2026 00:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates azure-monitor-opentelemetry-exporter samples/docs to use the LoggingHandler implementation from opentelemetry-instrumentation-logging (since opentelemetry.sdk._logs.LoggingHandler is being deprecated), and bumps pinned OpenTelemetry API/SDK versions accordingly.

Changes:

  • Bump opentelemetry-api and opentelemetry-sdk pins from 1.391.40.
  • Update README + log samples to import LoggingHandler from opentelemetry.instrumentation.logging.handler.
  • Add a changelog entry describing the import-path change.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
sdk/monitor/azure-monitor-opentelemetry-exporter/setup.py Updates pinned OpenTelemetry API/SDK versions.
sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs/sample_properties.py Switches LoggingHandler import to instrumentation package.
sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs/sample_log.py Switches LoggingHandler import to instrumentation package.
sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs/sample_exception.py Switches LoggingHandler import to instrumentation package.
sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs/sample_custom_event.py Switches LoggingHandler import to instrumentation package.
sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs/sample_correlate.py Switches LoggingHandler import to instrumentation package.
sdk/monitor/azure-monitor-opentelemetry-exporter/README.md Updates code snippets to use new LoggingHandler import path.
sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md Notes the import-path change for LoggingHandler.

You can also share your feedback on Copilot code review. Take the survey.

@rads-1996 rads-1996 force-pushed the logging-handler branch 2 times, most recently from ec9bd0d to b64b5f7 Compare March 6, 2026 16:48
@rads-1996
Copy link
Member Author

/check-enforcer override

2 similar comments
@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996
Copy link
Member Author

/check-enforcer override

1 similar comment
@rads-1996
Copy link
Member Author

/check-enforcer override

Copy link
Member

@JacksonWeber JacksonWeber left a comment

Choose a reason for hiding this comment

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

LGTM

@rads-1996
Copy link
Member Author

/check-enforcer override

1 similar comment
@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996 rads-1996 enabled auto-merge (squash) March 18, 2026 15:56
@rads-1996 rads-1996 disabled auto-merge March 18, 2026 15:57
@rads-1996
Copy link
Member Author

/check-enforcer override

2 similar comments
@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996
Copy link
Member Author

/check-enforcer override

@rads-1996 rads-1996 merged commit 63f2acb into Azure:main Mar 18, 2026
17 of 20 checks passed
"opentelemetry-api==1.39",
"opentelemetry-sdk==1.39",
"opentelemetry-api==1.40",
"opentelemetry-sdk==1.40",
Copy link
Member

Choose a reason for hiding this comment

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

This conflicts with the version in sdk/monitor/azure-monitor-opentelemetry

Copy link
Member Author

Choose a reason for hiding this comment

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

I will update the versions in azure-monitor-opentelemetry after the exporter is released. azure-monitor-opentelemetry depends on the exporter, so the versions have to updated there first before making changes in azure-monitor-opentelemetry

Copy link
Member

Choose a reason for hiding this comment

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

Can you update it now? It blocks the azure-core release.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you update it now? It blocks the azure-core release.

I am trying to release the exporter. Until that is released, the distro changes will fail, even if I update them. Give me some time, I am working on releasing the exporter.

Copy link
Member

@scbedd scbedd Mar 18, 2026

Choose a reason for hiding this comment

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

@rads-1996 what is your alias? I'll reach out over teams. You can skip the failing check with a queue time build variable of Skip.AnalyzeDependencies with value of true to get your release out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a commit I can use to release the exporter? If I use the https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6030525, it fails because of the dependency mismatch, I am using the skip.test=true and BuildTargetingString = azure-monitor-opentelemetry-exporter

Copy link
Member Author

@rads-1996 rads-1996 Mar 19, 2026

Choose a reason for hiding this comment

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

@xiangyan99 I have released the exporter and have another PR up for review which updates the otel versions in azure-monitor-opentelemetry - #45539. Once it is approved, I will merge the PR.
EDIT: The PR has been merged. This should unblock your release.

@rads-1996 rads-1996 deleted the logging-handler branch March 19, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants