Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@
# duplicates across multiple AgentServerHost instantiations.
_CONSOLE_HANDLER_ATTR = "_agentserver_console"

# Logger names whose INFO messages are too noisy by default (set to WARNING unless the user requests DEBUG).
_SUPPRESSED_LOGGERS = (
"azure.monitor.opentelemetry.exporter",
"azure.core.pipeline.policies.http_logging_policy",
)


def configure_observability(
*,
Expand Down Expand Up @@ -131,8 +137,13 @@ def configure_observability(
setattr(_console, _CONSOLE_HANDLER_ATTR, True)
root.addHandler(_console)

# 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.
Comment thread
singankit marked this conversation as resolved.
# 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)
Comment thread
singankit marked this conversation as resolved.

# Tracing and OTel export
_configure_tracing(connection_string=connection_string, enable_sensitive_data=enable_sensitive_data)
Expand Down
Loading