open-telemetry / open-telemetry/opentelemetry-python-genai
opentelemetry-instrumentation-genai-langchain gaps vs openinference instrumentation
Open
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 GenAIinvoke_workflow(#578) - Classify agent chains by name on
on_chain_start(langchain_core.callbacks.BaseCallbackHandler.on_chain_start) - maps to GenAIinvoke_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_konchat(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_namemetadata onchat(OpenInference:llm.model_name, semconv:gen_ai.request.model) (#582) - Capture token usage from
llm_outputandgeneration_infofallbacks onchat(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
- Add workflow node / chain step span on
on_chain_start(langchain_core.callbacks.BaseCallbackHandler.on_chain_start) (OpenInference:openinference.span.kind = "CHAIN") (https://github.com/open-telemetry/semantic-conventions-genai/issues/188)
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_startspan (langchain_core.callbacks.BaseCallbackHandler.on_llm_start) - maps to GenAItext_completion - Support legacy
promptsontext_completion(OpenInference:llm.prompts)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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