Improve logging to prevent customers from double instrumenting - #44682
Merged
Conversation
jeremydvoss
requested review from
JacksonWeber,
MSNev,
hectorhdzg,
lzchen and
rads-1996
as code owners
January 15, 2026 23:36
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request enhances the double-instrumentation warning by logging it to both the standard log stream and diagnostic logs. This helps customers identify double-instrumentation issues more easily without needing to access separate diagnostic logs.
Changes:
- Modified
_send_attach_warning()to output the warning message to the standard logger (_logger.warning()) in addition to diagnostic logging - Extracted the warning message into a variable to avoid duplication
- Updated CHANGELOG to document this feature addition
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_configure.py | Added _logger.warning() call to surface double-instrumentation message in log stream alongside diagnostic logging |
| sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md | Documented the feature addition under "Features Added" section for version 1.8.5 |
jeremydvoss
force-pushed
the
double-instrumment-log
branch
from
January 16, 2026 00:17
4efeaab to
9943847
Compare
jeremydvoss
marked this pull request as draft
January 16, 2026 00:35
jeremydvoss
force-pushed
the
double-instrumment-log
branch
from
January 16, 2026 00:51
4b92b21 to
ac4929d
Compare
jeremydvoss
marked this pull request as ready for review
January 16, 2026 00:53
jeremydvoss
force-pushed
the
double-instrumment-log
branch
from
January 16, 2026 21:22
50a2444 to
4896cfc
Compare
…ss/azure-sdk-for-python into double-instrumment-log
JacksonWeber
approved these changes
Jan 16, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Following the design of other diagnostic logs, we should send the double instrumentation log to log stream in addition to the diagnostic logs. This will help inform customers when they have wrongfully double-instrumented before reaching out to support. I also improved the log to more clearly instruct distro customers to disable autoinstrumentation.
Issue
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines