Part 5 of 12 · 2 min read
Standard names and measured overhead are what make tracing usable, not just possible
A trace that uses attribute names only one tool understands, or instrumentation whose own cost nobody measured, is a trace that's harder to use than it should be.
Think of shipping containers before standard sizes existed: every port needed its own cranes and its own handling rules, because nothing was shaped the same way twice.
In plain words: semantic conventions are agreed-on names for attributes and spans so that different tools can read the same data, instrumentation is the code that actually creates spans, an exporter sends recorded telemetry to a backend, and none of this is free -- the tracer itself adds a measurable, small overhead per span that should be checked on your own machine rather than assumed to be zero.
A worked example. The example run's spans use operation names invoke_agent, chat, and execute_tool, and attribute names like gen_ai.usage.input_tokens -- names chosen to follow a secondary source's account of the OpenTelemetry Gen-AI conventions, explicitly marked as still in a "Development" status where names can and do change. Measuring the tracer's own cost directly, with no export step, on this machine gives about 2.3 microseconds per span over 20,000 created spans -- small, but not zero, and a real SDK with batching and network export would add more.
The key lines. From code/mini-tracing/tracing.py:
# from code/mini-tracing/tracing.py
def overhead_per_span(n=20000):
"""Measured wall time per span with the real clock (microseconds)."""
tr = Tracer()
t0 = time.perf_counter()
for _ in range(n):
with tr.span("x", a=1):
pass
return (time.perf_counter() - t0) / n * 1e6
Read it as: the function actually times 20,000 real span creations with the real clock rather than estimating. "Instrumentation is cheap" is a claim worth checking with a stopwatch, not assuming. That is why this number is measured rather than quoted from documentation. It is also why the module says plainly that it will vary by machine.
Semantic conventions, instrumentation, exporter
Semantic conventions are agreed names for attributes and spans, so different tools read the same data. Instrumentation is code that creates spans. An exporter sends telemetry to a backend.
Example: using gen_ai.usage.input_tokens instead of inventing your own field name is what lets a cost dashboard built for one agent framework also work on a trace produced by a completely different one -- which is the entire point of a shared convention, even one still labeled in development.