Instrumentation: Coverage Is the Product, Not the Agent
That's why instrumentation is a coverage problem, not a technology problem. 95% coverage is not 95% of the value. The one service nobody instrumented is exactly where the unexplained latency piles up. Worse, the Trace part's silent-reparenting case means its children can re-attach to its grandparent — so the graph isn't just incomplete, it's wrong about who calls whom.
How Auto-Instrumentation Actually Works, Per Runtime
Every runtime solves the same problem — "wrap the library calls without touching app code" — in a completely different way, and each way fails differently:
| Runtime | How it hooks in | The catch |
|---|---|---|
| Java | You add -javaagent:opentelemetry-javaagent.jar. The agent installs a ClassFileTransformer and rewrites bytecode as each class loads, using Byte Buddy to match known library types — "any class implementing javax.servlet.Servlet," for instance. It ships instrumentation for 180+ libraries and frameworks plus ~13 app-server variants, on Java 8+. | It can only transform classes loaded after it attaches. Shaded or relocated dependencies don't match its patterns. Fat-jar class loaders and OSGi need explicit support. |
| Python / Node / Ruby | It intercepts the module loader and monkey-patches. opentelemetry-instrument <your-app> patches modules as they're imported; Node uses --require @opentelemetry/auto-instrumentations-node/register to hook require() and the ESM loader before your code runs. | Load order is everything. Anything imported before the hook is installed never gets patched — this is the single most common cause of "auto-instrumentation isn't working." |
| Go | Monkey-patching at runtime is simply impossible here. Go compiles and links statically: no class loader, no import hook, no dispatch table to swap out. So you get three options — (a) write spans by hand, (b) wrap things with middleware like otelhttp.NewHandler or otelgrpc interceptors, or (c) go outside the process with eBPF via opentelemetry-go-instrumentation, which reads DWARF debug info out of the target binary and attaches uprobes at known function offsets. | The eBPF path hit beta (2026) covering net/http, database/sql, gRPC and kafka-go; the wider OTel eBPF Instrumentation (OBI) project is still v0, with a stable 1.0 as its 2026 flagship goal. Treat it as production-adjacent, not production-settled. One quirk worth knowing: uretprobes and Go don't mix, so it scans the binary for every RET instruction instead. |
| .NET | The odd one out: System.Diagnostics.Activity and DiagnosticSource live in the base class library, so the platform itself owns the tracing primitive. ActivitySource emits W3C-format ids natively and OTel just subscribes to it as a listener. | Two vocabularies end up side by side (Activity vs. OTel Span), and attribute naming drifts between BCL-emitted and OTel-emitted tags unless you normalise it. |
The Ceiling on "Free Tracing from the Service Mesh"
eBPF probes and sidecar proxies do give you real spans for zero code changes: span kind, duration, peer address, status code — everything visible at the syscall or L7-proxy boundary. But they hit three hard limits, and the third is the one that decides the argument:
They can't see inside the process. A handler that burns 280ms on a synchronous cache miss and 20ms on a DB call looks, from the socket, like a 300ms handler with one 20ms child. The internal structure — the part you're actually after — is invisible.
They can't attach business attributes.
tenant.id,cart.item_count,feature_flag.checkout_v3exist only in your variables. A syscall probe sees bytes, not meaning — which runs straight into the Where Tracing Stops part's argument that high-cardinality business attributes are the whole point.Something that only observes a hop can't propagate context it doesn't own. This is the load-bearing limit. A sidecar sees a request come in and a request go out, and has no way to know the two are connected — that relationship exists only inside your handler.
Semantic Conventions — the Actual Product Is the Vocabulary
A span that says "this took 300ms" is worth nothing across 23 services unless all 23 name the same thing the same way. That shared vocabulary is what makes a service graph, a cross-service latency comparison, or a single alert possible at all. Here's the current stable HTTP and network set, with what each field used to be called:
http.request.method "GET" (was: http.method)
http.response.status_code 500 (was: http.status_code)
url.full "https://a/b?c=1" (was: http.url)
url.path / url.query "/b" / "c=1" (was: http.target, one field)
url.scheme "https" (was: http.scheme)
server.address / .port "payments" / 8443 (was: net.peer.name / net.peer.port)
client.address "203.0.113.4" (was: http.client_ip)
network.protocol.version "1.1" (was: http.flavor)
network.peer.address/.port socket-level peer (was: net.sock.peer.addr/.port)
user_agent.original raw UA string (was: http.user_agent)
db.system.name "postgresql" (was: db.system)
db.query.text "SELECT ..." (was: db.statement)
db.operation.name "SELECT" (was: db.operation)
db.collection.name "orders" (was: db.sql.table, db.mongodb.collection, ...)
rpc.system / rpc.service / rpc.method
service.name resource attribute — see belowThose left-hand names aren't tidier spellings — they're the stable ones. HTTP was declared stable in semantic conventions v1.23.0 (late 2023); database took considerably longer (stable by v1.33.0). The rename broke every fleet that had already adopted the old names, and OTel's answer is an opt-in env var:
OTEL_SEMCONV_STABILITY_OPT_IN | unset → keep emitting the old names · http → emit stable only · http/dup → emit both · database / database/dup → same for DB |
|---|---|
| Deprecation policy | An instrumentation must keep its major version for ≥6 months after it starts dual-emitting, then may drop the flag in the next major. OTel JS, for example, retires it around mid-2026 with SDK v3. |
Treat a semconv migration as a schema migration, because that's what it is. The dual-emission flag exists for one reason: you can't cut a fleet over atomically. Every dashboard panel, alert rule, saved query and derived metric is tied to an attribute name. So the sequence is: turn on
http/dupeverywhere → rewrite your queries against the new names → verify → flip tohttp→ and accept roughly 2× the attribute cost on every span for as long as the overlap lasts (see What It Costs).
Cardinality Discipline — Where the Split Comes From
The rule is one line: span names low-cardinality, attributes high-cardinality. The OTel API spec says a span name "SHOULD be the most general string that identifies a (statistically) interesting class of Spans, rather than individual Span instances," and gives the canonical examples: get is too broad, get_account/42 is too specific, and both get_account and get_account/{accountId} are right.
This isn't about taste — it's a constraint on the shape of the index (see Trace Storage). Backends keep an inverted index over (service, operation) so that the "find traces" query has a bounded list of entries to walk. Put an order id in the span name and you create one new index term per request: the operation-name dictionary grows without limit, every "list operations" dropdown in the UI becomes unusable, and Cassandra or Elasticsearch term dictionaries blow out. Attributes are stored in a different structure, one built to tolerate exactly that.
What Instrumentation Costs — and the Silent Drop
The cost isn't where people assume. Creating a span is cheap — one allocation plus a small map. What dominates is serializing attributes and exporting them over the network: encoding 20 attributes into OTLP protobuf and pushing them over gRPC is string work and syscalls. So overhead scales with attributes × string length × span rate, not with span count alone. That's why "we added tracing and it got slow" almost always turns out to be "we added 40 attributes per span." (Rough order of magnitude: single-digit microseconds per span in-process for creation plus attributes on a typical JVM or Go service. Treat any specific number as workload-dependent and measure your own — published cross-language benchmarks aren't authoritative here.)
Between your hot path and the exporter sits the BatchSpanProcessor. Its spec defaults:
maxQueueSize | 2048 — "after the size is reached, spans are dropped" |
|---|---|
maxExportBatchSize | 512 — must be ≤ queue size |
scheduledDelayMillis | 5000 — max gap between exports |
exportTimeoutMillis | 30000 — export cancelled after this |
Those four numbers have a consequence people rarely work out: with one export in flight at a time, they put a hard ceiling on how fast a single process can drain spans.
drain_rate ≈ maxExportBatchSize ÷ export_latency → 512 ÷ 0.25 s ≈ 2,048 spans/s per process
What a Correct Span Actually Looks Like
✗ Unindexable name, no semconv, swallowed error
span = tracer.start_span(
f"GET /orders/{order_id}") # 1 index
# term per order
span.set_attribute("url", url) # not semconv
span.set_attribute("code", 500) # not semconv
try:
r = call(url)
except Exception:
pass # span ends OK;
# trace says success
finally:
span.end()✓ Route template, semconv, exception + status recorded
with tracer.start_as_current_span(
"GET /orders/{order_id}", # template
kind=SpanKind.CLIENT,
attributes={
"http.request.method": "GET",
"url.full": url,
"server.address": "orders-api",
"order.id": order_id, # high card
}) as span: # -> attribute
try:
r = call(url)
span.set_attribute(
"http.response.status_code", r.status)
if r.status >= 500:
span.set_status(StatusCode.ERROR)
except Exception as e:
span.record_exception(e)
span.set_status(StatusCode.ERROR, str(e))
raiseThree things the right column does that the left one can't:
The order id is an attribute, not part of the name. So the span name stays a single index term no matter how many orders you process.
record_exceptionkeeps the failure. It writes the stack trace as a span event carryingexception.type,exception.messageandexception.stacktrace, instead of letting a bareexcept: passthrow it away.set_status(ERROR)makes the span findable. "Show me the errors" is the one query that matters during an incident, and this is what answers it.
That last one is worth stating bluntly: a span that failed but reports UNSET status is worse than no span at all. It tells the same lie the uninstrumented hop tells — just from closer in, and with more apparent authority.
- Guarantees: Auto-instrumentation produces correctly-parented spans with conventional attributes for the libraries it recognises, with no source changes — and the API/SDK split (see OpenTelemetry) means a library instrumented with the API is a no-op if nobody configures an SDK.
- Does not guarantee: Coverage, context propagation across boundaries it doesn't own, stable attribute names across semconv versions, or that a span you created was ever exported. The batch processor drops silently, and the UI renders the result as a structurally valid trace.