Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#49,477 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
observability

調査の方向性

まず、use_microsoft_opentelemetry() を呼び出している Agent Server の observability 設定を読み、次に logger_name が指定されたときに microsoft-opentelemetry が plain OTLP ロギングをどのように設定するか確認してください。issue の説明どおりに root logger 名を渡し、ホストの初期化を繰り返しても冪等性が保たれることを確認してください。plain OTLP モードで標準の Python ログが重複する handler なしに OTLP バックエンドへ届けば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
5.6k
フォーク
3.4k
平均マージ
2日 3時間
マージ済み PR(30日)
206

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/azure-sdk-for-python のほかの issue

Azure/azure-sdk-for-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。