open-telemetry / open-telemetry/opentelemetry-python-genai
[langchain] Capture prompt template name and variables on chat
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39
- Forks
- 63
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 175
Description
[!NOTE]
This issue was generated with AI assistance and requires investigation and confirmation prior to being worked on.
Part of #543.
When LangChain chat models are invoked with a PromptTemplate or ChatPromptTemplate, prompt template details are currently omitted.
Semantic conventions define prompt template attributes:
gen_ai.prompt.namegen_ai.prompt.variable.<key>
Task:
- Extract template name from serialized representation or metadata ->
gen_ai.prompt.name - Extract template variable inputs ->
gen_ai.prompt.variable.<key>
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 chat model instrumentation related to issue #543 and inspect how prompt inputs are serialized or exposed through metadata. Determine how to capture the template name and input variables, then verify that chat invocations emit gen_ai.prompt.name and gen_ai.prompt.variable. attributes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100