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

opentelemetry-instrumentation-genai-langchain gaps vs openinference instrumentation

Open
#543 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
  • Add nested workflow span on on_chain_start (langchain_core.callbacks.BaseCallbackHandler.on_chain_start) - maps to GenAI invoke_workflow (#578)
  • Classify agent chains by name on on_chain_start (langchain_core.callbacks.BaseCallbackHandler.on_chain_start) - maps to GenAI invoke_agent (#579)
Missing Attributes & Features
  • Capture audio input tokens on chat (OpenInference: llm.token_count.prompt_details.audio, semconv: gen_ai.usage.audio.input_tokens) (#580)
  • Capture audio output tokens on chat (OpenInference: llm.token_count.completion_details.audio, semconv: gen_ai.usage.audio.output_tokens) (#580)
  • Capture top_k on chat (OpenInference: llm.invocation_parameters, semconv: gen_ai.request.top_k) (#581)
  • Capture choice count on chat (OpenInference: llm.invocation_parameters, semconv: gen_ai.request.choice.count) (#581)
  • Capture request model from ls_model_name metadata on chat (OpenInference: llm.model_name, semconv: gen_ai.request.model) (#582)
  • Capture token usage from llm_output and generation_info fallbacks on chat (OpenInference: llm.token_count.prompt / llm.token_count.completion, semconv: gen_ai.usage.input_tokens / gen_ai.usage.output_tokens) (#583)
  • Capture document score on retrieval (OpenInference: document.score, semconv: gen_ai.retrieval.documents) (#584)
  • Capture prompt template name and variables on chat (OpenInference: llm.prompt_template.template / llm.prompt_template.variables, semconv: gen_ai.prompt.name / gen_ai.prompt.variable) (#585)

Blocked on Semantic Conventions

Missing Spans
Missing Attributes & Features
  • Capture total token count on chat (OpenInference: llm.token_count.total)
  • Capture raw invocation parameters blob on chat (OpenInference: llm.invocation_parameters)
  • Capture raw metadata JSON blob on all spans (OpenInference: metadata)

Gaps for Legacy APIs

  • Add legacy on_llm_start span (langchain_core.callbacks.BaseCallbackHandler.on_llm_start) - maps to GenAI text_completion
  • Support legacy prompts on text_completion (OpenInference: llm.prompts)

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 the LangChain callback entry points named in the issue: on_chain_start, chat, retrieval, and on_llm_start, and compare their current instrumentation with the listed OpenInference mappings. Done means the unblocked checklist items are implemented for the relevant spans and attributes, while items blocked on semantic conventions remain pending.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.