Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[azure-ai-agentserver-core] Standard Python logs are not exported in plain OTLP mode

Abierto Apto para principiantes
#49,477 4 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Empieza leyendo la configuración de observabilidad de Agent Server, donde se llama a use_microsoft_opentelemetry(), y luego comprueba cómo microsoft-opentelemetry configura el registro plain OTLP cuando se proporciona logger_name. Pasa el nombre del logger raíz tal como se describe en el issue y comprueba que las inicializaciones repetidas del host sigan siendo idempotentes. Se considera terminado cuando los logs estándar de Python llegan al backend OTLP en modo plain OTLP sin handlers duplicados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Client customer-reported Hosted Agents needs-team-attention question Service Attention
  • Package Name: azure-ai-agentserver-core
  • Package Version: 2.1.0
  • Related Package: microsoft-opentelemetry 1.3.9
  • Operating System: Linux (containerized runtime)
  • Python Version: 3.13

Describe the bug

When azure-ai-agentserver-core is configured with an OTLP endpoint but no
Application Insights connection string, standard Python logs are not exported
through the OTLP logs pipeline.

The plain OTLP path successfully creates a LoggerProvider, log record
processors, and an OTLPLogExporter. However, Agent Server does not pass a
logger_name to use_microsoft_opentelemetry(). In
microsoft-opentelemetry==1.3.9, the plain OTLP setup attaches an
OpenTelemetry LoggingHandler only when logger_name is truthy. As a result,
the provider/exporter pipeline exists but is not connected to Python's root
logger.

This produces different behavior between the two supported export modes:

  • Azure Monitor mode: standard Python logs are exported.
  • Plain OTLP mode: direct OTel Logs API records are exported, but
    logging.info(), Agent Server logs, and library logs are not.

To Reproduce

  1. Configure the process with an OTLP endpoint and no Application Insights
    connection string:

    OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
    OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
    APPLICATIONINSIGHTS_CONNECTION_STRING is unset
    
  2. Construct an Agent Server host using the default observability setup:

    import logging
    from azure.ai.agentserver.responses import ResponsesAgentServerHost
    
    app = ResponsesAgentServerHost()
    logging.getLogger(__name__).warning("standard-python-log")
    
  3. Send an invocation and inspect the configured OTLP backend.

  4. Observe that traces and direct OTel log records arrive, but
    standard-python-log does not.

Expected behavior

Standard Python logging should be connected to the LoggerProvider in plain
OTLP mode, matching the logging behavior of the Azure Monitor mode.

Agent Server can provide this behavior by passing the root logger explicitly:

use_microsoft_opentelemetry(
    ...,
    logger_name="root",
)

logging.getLogger("root") resolves to Python's root logger. This preserves
Azure Monitor behavior while activating the existing plain OTLP
LoggingHandler setup.

The implementation should remain idempotent so repeated host initialization
does not create duplicate handlers or duplicate log export.

Lenguaje dominante
Python
Estrellas
5.6k
Forks
3.4k
Merge medio
2 d 6 h
PR fusionados (30 d)
212

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-sdk-for-python

Todos los issues de Azure/azure-sdk-for-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.