microsoft / microsoft/Agent365-python

InferenceOperationType.value casing inconsistent with OTel GenAI semantic conventions

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

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

主要言語
Python
スター
41
フォーク
23
平均マージ
7時間 43分
マージ済み PR(30日)
3

説明

Issue

The InferenceOperationType enum in libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_operation_type.py uses capitalized values (Chat, TextCompletion, GenerateContent). These values flow into gen_ai.operation.name span attributes via InferenceScope (manual instrumentation).

The OpenTelemetry GenAI semantic conventions specify lowercase for gen_ai.operation.name values (e.g., chat, text_completion, embeddings). The auto-instrumentation extension packages (e.g., microsoft-agents-a365-observability-extensions-openai) correctly emit lowercase values.

Effect

Customers using manual instrumentation see gen_ai.operation.name="Chat", customers using auto instrumentation see gen_ai.operation.name="chat" for the same operation. Backend filters and dashboards built around one casing won't match spans produced by the other.

Repro

End-to-end run of the two samples in microsoft/Agent365-Samples PR #288:

  • python/observability-with-otlp/main.py (manual instrumentation): emits gen_ai.operation.name="Chat", span name Chat gpt-4o-mini
  • python/observability-with-azure-monitor/main.py (auto-instrumentation): emits gen_ai.operation.name="chat", span name chat gpt-4.1

Suggested fix

Change InferenceOperationType values to lowercase to match the OTel spec and auto-instrumentation behavior:

```python
class InferenceOperationType(Enum):
CHAT = "chat"
TEXT_COMPLETION = "text_completion"
GENERATE_CONTENT = "generate_content"
```

This is a behavior change — backend dashboards filtering by Chat would stop matching. May need a major-version bump or a transitional period.

Related

  • PR #288 in Agent365-Samples documents the discrepancy in the sample READMEs
  • Companion docs PR (forthcoming) on Agent365-python documents it in the integration guide

🤖 Filed via Claude Code while validating samples

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_operation_type.py から始め、値が InferenceScope を介して gen_ai.operation.name に到達するまでを追跡します。Agent365-Samples PR #288 で説明されている手動インストルメンテーションと自動インストルメンテーションのエントリポイントを比較します。手動インストルメンテーションが自動インストルメンテーションと同じ小文字のオペレーション名を出力し、互換性への影響が考慮されていれば完了です。

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

評価

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

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

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