open-telemetry / open-telemetry/opentelemetry-python-genai

opentelemetry-instrumentation-genai-openai gaps vs openinference instrumentation

Open
#541 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

openinference-migration
Dominant language
Python
Stars
39
Forks
63
Avg merge
1d 15h
Merged PRs (30d)
175

Description

Ready to Fix

Missing Spans
  • None
Missing Attributes & Features
  • Capture cached prompt tokens on chat in patch.py and chat_wrappers.py from usage.prompt_tokens_details.cached_tokens (OpenInference: llm.token_count.prompt_details.cache_read, semconv: gen_ai.usage.cache_read.input_tokens) #546
  • Capture reasoning tokens on chat in patch.py and chat_wrappers.py from usage.completion_tokens_details.reasoning_tokens (OpenInference: llm.token_count.completion_details.reasoning, semconv: gen_ai.usage.reasoning.output_tokens) #547
  • Support multimodal image_url parts in input messages on chat in utils.py (OpenInference: message.contents.*.message_content.image.image_url, semconv: gen_ai.input.messages image parts) #548

Blocked on Semantic Conventions

Missing Spans
  • Add responses.cancel span (openai.resources.responses.Responses.cancel)
  • Add images.generate span (openai.resources.images.Images.generate)
  • Add audio.transcriptions.create span (openai.resources.audio.Transcriptions.create)
  • Add audio.translations.create span (openai.resources.audio.Translations.create)
  • Add audio.speech.create span (openai.resources.audio.Speech.create)
  • Add moderations.create span (openai.resources.moderations.Moderations.create) (https://github.com/open-telemetry/semantic-conventions-genai/pull/427)
  • Add batches.create span (openai.resources.batches.Batches.create)
  • Add files.create span (openai.resources.files.Files.create)
Missing Attributes & Features

Gaps for Legacy APIs

  • Add beta.assistants.create span (openai.resources.beta.assistants.Assistants.create / AsyncAssistants.create) - maps to GenAI gen_ai.create_agent.client (create_agent) #544
  • Add beta.threads.runs.create span (openai.resources.beta.threads.runs.Runs.create / AsyncRuns.create) - maps to GenAI gen_ai.invoke_agent.client (invoke_agent) #545
  • Add legacy completions.create span (openai.resources.Completions.create / AsyncCompletions.create) - maps to GenAI gen_ai.inference.client (text_completion)
  • Support legacy function_call message parameter and assistant choice on chat in utils.py (OpenInference: message.function_call_name, message.function_call_arguments_json)
  • Support legacy functions parameter in request tool definitions on chat in utils.py (OpenInference: llm.tools.*.tool.json_schema)

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

Treat this as an umbrella issue and first choose one unblocked checklist item. Read the relevant entry points named in the issue—patch.py and chat_wrappers.py for chat usage attributes, or utils.py for multimodal and legacy message handling—then compare the listed OpenInference and semantic-convention mappings. Done means one selected gap is supported and its instrumentation output matches the stated mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.