microsoft / microsoft/Agent365-python

InferenceOperationType.value casing inconsistent with OTel GenAI semantic conventions

Open Beginner friendly
#249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
41
Forks
23
Avg merge
7h 43m
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_operation_type.py and trace how its values reach gen_ai.operation.name through InferenceScope. Compare the manual and auto-instrumentation sample entry points described in Agent365-Samples PR #288. Done means manual instrumentation emits the same lowercase operation names as auto-instrumentation, with the compatibility impact considered.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.