Pick the OTel GenAI attribute that records the sampling temperature
Temperature is an input you send to the model, so it lives under gen_ai.request.* in the OTel GenAI semantic conventions.
Picture ordering coffee at a counter. The barista records two kinds of things on a sticky note: what you asked for (large oat latte, extra hot) and what actually happened (took 3 minutes, $5.25). Temperature is in the first bucket. You picked it before the model did any work. OpenTelemetry follows the same rule. Anything you chose up front, like how creative the answer should be or how long it can run, goes in the request box. Anything the model produced, like the answer text or how long it took, goes in the response box. So the right shelf for temperature is the request shelf, not the response shelf and not the shelf that names which coffee shop you walked into.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
The OpenTelemetry GenAI semantic conventions were standardized between 2024 and 2026 to give LLM spans a portable shape. Before them, every vendor SDK invented its own attribute names and dashboards were locked to whichever shape happened to write the trace.
This question targets the most foundational distinction in the spec: the namespace split between gen_ai.system, gen_ai.request, gen_ai.response, and gen_ai.usage. Get this split right and most of the rest of the convention follows from a quick reference lookup. Get it wrong and your spans drift into vendor-proprietary keys that do not survive a backend migration.
Why the namespaces exist
The convention authors faced a real design tension. A model call has dozens of relevant fields, and they originate at different points in the call lifecycle. Some are picked by the caller before the request leaves the process. Some come back from the provider only after the response is decoded. Some, like token counts, are billing-relevant and need their own surface.
The four-way split solves this cleanly. gen_ai.system is a single low-cardinality string set per-span from static config (openai, anthropic, vertex_ai, bedrock). gen_ai.request.* covers what you sent: model id, temperature, top_p, max_tokens, seed, response_format hints. gen_ai.response.* covers what came back: the resolved response model, finish reasons, the provider response id. gen_ai.usage.* is the billing slice: input_tokens, output_tokens, and (in newer drafts) cache-hit and reasoning-token counts.
Each namespace has a different finalization point in the span lifecycle, which matters when the SpanProcessor decides what to ship and when.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Langfuse renders gen_ai.request.temperature directly in the span detail panel and lets you filter traces by it.
- Arize Phoenix and OpenLLMetry both emit gen_ai.request.* attributes for OpenAI, Anthropic, and Bedrock instrumentations.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do gen_ai.usage.* attributes behave during a streaming response?
Talk about partial vs final finalization and when the SpanProcessor sees the final values.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Guessing gen_ai.system.temperature because temperature sounds like a property of the model itself rather than of the call you made.
60 second bullets to scan on the way to the call.
Name the three top-level OTel GenAI namespaces and what each holds
Recall the full attribute key for temperature, max_tokens, and top_p
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.