🚀 Feature: Ollama instrumentation missing inference metadata attributes in spans
Maintainers usually reply within 1 day
@krishna231122-del is already working on this.
Since Jun 15, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- ollama, python
- Domain
- observability-sre
Research direction
Locate the Ollama instrumentation response-attribute extraction path and review how prompt and evaluation token metadata is attached to spans. Add the four duration fields as span attributes alongside the existing response metadata, then run the relevant Ollama instrumentation tests and verify the exported spans contain them.
Written by the indexing model from the issue text.
Description
Which component is this feature for?
Ollama Instrumentation
🔖 Feature description
Ollama responses expose useful inference duration metadata such as:
total_durationload_durationprompt_eval_durationeval_duration
However, these values are currently not propagated into exported tracing span attributes.
From reviewing the current instrumentation implementation, token-related metadata such as prompt_eval_count and eval_count already appear to be handled correctly, but duration-related telemetry fields are not currently attached to spans.
The Ollama API response contains richer performance telemetry data that could improve observability quality.
🎤 Why is this feature needed ?
These duration metrics are useful for debugging and performance analysis.
For example:
load_durationhelps identify cold start/model loading overheadeval_durationhelps analyze inference latencyprompt_eval_durationhelps measure prompt processing costtotal_durationprovides useful end-to-end execution timing insight
During local testing, these values were available in the Ollama API response but were not included in exported span attributes.
This makes it harder to analyze inference bottlenecks and distinguish model loading overhead from evaluation latency through observability tooling.
✌️ How do you aim to achieve this?
Extract the duration-related fields from the Ollama response payload and attach them as span attributes during instrumentation.
Example candidate attributes:
llm.ollama.total_duration
llm.ollama.load_duration
llm.ollama.prompt_eval_duration
llm.ollama.eval_duration
The existing response attribute extraction path already handles token metadata, so duration metrics could likely be added alongside the current response attribute handling logic.
🔄️ Additional Information
Example observed Ollama response:
{
"total_duration": 115588345200,
"load_duration": 53118691900,
"prompt_eval_count": 11,
"prompt_eval_duration": 48132531100,
"eval_count": 26,
"eval_duration": 13506373700
}
Current exported spans do not appear to include the duration-related response fields.
During investigation, token usage attributes appeared to already be propagated correctly, but the duration-related response fields were not attached to spans.
👀 Have you spent some time to check if this feature request has been raised before?
- I checked and didn't find similar issue
Are you willing to submit PR?
Yes I am willing to submit a PR!
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from traceloop/openllmetry
-
bug python
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
traceloop/openllmetry#4717 ·
Maintainers usually reply within 1 day
-
🐛 Bug Report: Incomplete cache token migration after #4243 breaks Bedrock and Groq instrumentationPossibly taken @Quantum-Enigma-dot claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
traceloop/openllmetry#4665 · 1 comment ·
Maintainers usually reply within 1 day
-
🐛 Bug Report: OpenAI instrumentation drops gen_ai.usage.reasoning_tokens on streamed chat completionsPossibly taken @jayfeng7 claimed this 23 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
traceloop/openllmetry#4660 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug Report: Failed dataset deletes still remove local rows and columnsPossibly taken @inchang-ing claimed this 32 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
traceloop/openllmetry#4630 ·
Maintainers usually reply within 1 day
-
🐛 Bug Report: LiteLLM instrumentation does not record seed, stop, frequency_penalty, presence_penaltyPossibly taken @shantam77 claimed this 38 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
traceloop/openllmetry#4598 · 2 comments ·
Maintainers usually reply within 1 day
All issues in traceloop/openllmetry
Similar issues
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itPossibly taken @paulo-0308 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Diaoul/subliminal#1405 ·
-
Internal ErrorOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
frappe/frappe_docker#2071 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
The-Pocket/PocketFlow#161 ·
-
comp/desktop P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#157702 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
zai-org/zcode-plugins#202 ·
Maintainers usually reply within 1 day