Skip to content

Improve logging to prevent customers from double instrumenting#44682

Merged
jeremydvoss merged 13 commits intoAzure:mainfrom
jeremydvoss:double-instrumment-log
Jan 16, 2026
Merged

Improve logging to prevent customers from double instrumenting#44682
jeremydvoss merged 13 commits intoAzure:mainfrom
jeremydvoss:double-instrumment-log

Conversation

@jeremydvoss
Copy link
Member

@jeremydvoss jeremydvoss commented Jan 15, 2026

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:

  • 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.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings January 15, 2026 23:36
@github-actions github-actions bot added the Monitor - Distro Monitor OpenTelemetry Distro label Jan 15, 2026
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

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 jeremydvoss force-pushed the double-instrumment-log branch from 4efeaab to 9943847 Compare January 16, 2026 00:17
@jeremydvoss jeremydvoss marked this pull request as draft January 16, 2026 00:35
@jeremydvoss jeremydvoss force-pushed the double-instrumment-log branch from 4b92b21 to ac4929d Compare January 16, 2026 00:51
@jeremydvoss jeremydvoss marked this pull request as ready for review January 16, 2026 00:53
@jeremydvoss jeremydvoss changed the title Surface double-instrumentation message in log stream Improve logging to prevent customers from double instrumenting Jan 16, 2026
@jeremydvoss jeremydvoss force-pushed the double-instrumment-log branch from 50a2444 to 4896cfc Compare January 16, 2026 21:22
@jeremydvoss jeremydvoss merged commit c986fad into Azure:main Jan 16, 2026
20 checks passed
@rads-1996 rads-1996 mentioned this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants