InferenceOperationType.value casing inconsistent with OTel GenAI semantic conventions

Ouverte Adaptée aux débutants
#249 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Calme
Stack technique
python

Piste de recherche

Commencez par libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/inference_operation_type.py et suivez comment ses valeurs parviennent à gen_ai.operation.name via InferenceScope. Comparez les points d’entrée de l’instrumentation manuelle et automatique décrits dans Agent365-Samples PR #288. Le travail est considéré comme terminé lorsque l’instrumentation manuelle émet les mêmes noms d’opération en minuscules que l’instrumentation automatique, en tenant compte de l’impact sur la compatibilité.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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

Langage dominant
Python
Étoiles
41
Forks
23
Merge moyen
7 h 43 min
PR mergées (30 j)
3

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de microsoft/Agent365-python

Toutes les issues de microsoft/Agent365-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.