Skip to content

Users/singankit/supress noisy logs#47280

Open
singankit wants to merge 11 commits into
mainfrom
users/singankit/supress_noisy_logs
Open

Users/singankit/supress noisy logs#47280
singankit wants to merge 11 commits into
mainfrom
users/singankit/supress_noisy_logs

Conversation

@singankit
Copy link
Copy Markdown
Contributor

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

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.

singankit and others added 11 commits May 28, 2026 10:58
Disable azure_sdk instrumentation in opentelemetry distro setup
to reduce noise from internal Azure SDK telemetry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Set logging level to WARNING for the Azure Monitor OTel exporter
logger to reduce noise alongside the existing HTTP logging policy
suppression.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The azure.monitor.opentelemetry.exporter logger suppression must
happen after _configure_tracing() to catch child loggers created
during setup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…added ones

The _NoisyLoggerFilter was only applied to the SDK's own console handler,
but use_microsoft_opentelemetry() adds additional handlers to root that
bypass our filter. Now we apply the filter to ALL root handlers after
tracing setup completes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Setting logger level BEFORE use_microsoft_opentelemetry() ensures the
level is already in place when the distro creates handlers and background
threads. This matches the behavior of setting it in main.py (which works)
without needing NullHandler or propagate=False hacks.

Preserves full visibility when user sets log_level=DEBUG.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
resolve_log_level() returns a string like 'INFO', not an int.
Use logging.getLevelName() to convert before comparison.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove diagnostic prints and unnecessary post-distro re-application.
The distro respects pre-set logger levels, so a single setLevel(WARNING)
before _configure_tracing() is sufficient.
The pre-distro setLevel(WARNING) prevents INFO records from being
created, making the filter redundant.
Copilot AI review requested due to automatic review settings June 2, 2026 05:10
@github-actions github-actions Bot added the Hosted Agents sdk/agentserver/* label Jun 2, 2026
Copy link
Copy Markdown
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 PR updates azure-ai-agentserver-core’s observability setup to reduce noisy INFO-level console output by suppressing specific Azure logger names unless the user opts into DEBUG logging.

Changes:

  • Introduces a _SUPPRESSED_LOGGERS list to centralize “noisy” logger names.
  • Applies WARNING-level overrides for those loggers (when log_level is above DEBUG) before initializing OTel tracing/export.

Comment on lines +88 to +92
# Logger names whose INFO messages are too noisy for the console.
_SUPPRESSED_LOGGERS = (
"azure.monitor.opentelemetry.exporter",
"azure.core.pipeline.policies.http_logging_policy",
)
Comment on lines +140 to +146
# Suppress noisy loggers by setting their level to WARNING.
# Must be done BEFORE _configure_tracing() — the distro respects
# pre-set levels, preventing repetitive "Transmission succeeded" INFO messages.
# Preserve visibility when user explicitly requests DEBUG.
if logging.getLevelName(resolved_level) > logging.DEBUG:
for _noisy in _SUPPRESSED_LOGGERS:
logging.getLogger(_noisy).setLevel(logging.WARNING)

# Suppress the noisy Azure Core HTTP logging policy logger.
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.WARNING)
# Suppress noisy loggers by setting their level to WARNING.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hosted Agents sdk/agentserver/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants