InferenceOperationType.value casing inconsistent with OTel GenAI semantic conventions
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- python
调研方向
从 libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_operation_type.py 开始,跟踪其值如何通过 InferenceScope 到达 gen_ai.operation.name。比较 Agent365-Samples PR #288 中描述的手动和自动 instrumentation 入口点。完成的标准是:手动 instrumentation 发出的操作名称与自动 instrumentation 发出的相同且均为小写,同时考虑兼容性影响。
由索引模型根据 Issue 内容生成。
描述
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): emitsgen_ai.operation.name="Chat", span nameChat gpt-4o-minipython/observability-with-azure-monitor/main.py(auto-instrumentation): emitsgen_ai.operation.name="chat", span namechat 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
- 主要语言
- Python
- 星标
- 41
- 派生
- 23
- 平均合并
- 7 小时 43 分钟
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/Agent365-python 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 78/100
microsoft/Agent365-python#271 ·
-
难度 3/5 1-2 天 新手友好度 68/100
microsoft/Agent365-python#270 ·
-
难度 4/5 3-5 天 新手友好度 38/100
microsoft/Agent365-python#262 ·
-
microsoft/Agent365-python#257 · 2 条评论 · 已指派 1 人 ·
-
microsoft/Agent365-python#239 · 1 个 reaction · 已指派 2 人 ·
查看 microsoft/Agent365-python 的全部 Issue
相似的 Issue
-
area/auth bug comp/agent P3 platform/discord type/security
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
bancolombia/sentinel#23 ·
-
test md 未关闭CI
难度 2/5 1-3 小时 新手友好度 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
难度 2/5 1-3 小时 新手友好度 74/100
langchain-ai/deepagents#6450 ·
-
bug client
难度 2/5 1-3 小时 新手友好度 88/100