Cloud Native

eBPF Observability Has a Hot-Path Tax—Measure It Before Rollout

A new production account from STCLab’s SRE team puts a useful number on a cost that cloud-native observability discussions often leave abstract. When the team enabled OpenTelemetry eBPF Instrumentation, or OBI, on a high-throughput C daemon, CPU time per request rose from 41.6 microseconds to 51.8 microseconds at roughly 2,400 requests per second. That is a 25% increase, large enough to reduce peak throughput and keep the instrumentation off the hottest production instances.

The result is not an indictment of eBPF observability. It is a reminder that “zero code changes” does not mean zero runtime cost. eBPF can remove the integration burden of adding an SDK to an application, but probes still execute while requests are processed, context still has to be recovered, and telemetry still has to be assembled. For platform teams, the practical lesson is clear: evaluate automatic instrumentation as part of the workload’s performance envelope, not as a free external service.

A production measurement changes the question

OBI uses eBPF to observe application executables and the operating system’s networking layer. It can produce spans, RED metrics, runtime metrics and service relationships without modifying application code. That makes it especially attractive for compiled services, legacy binaries and workloads owned by teams that cannot prioritize an instrumentation project.

OpenTelemetry’s documentation describes OBI as lightweight and efficient, but those terms are necessarily relative. STCLab’s test supplies the missing operational context. The team alternated OBI on and off under equivalent load and measured the daemon’s CPU time per request using container cgroup counters. Measuring inside the application cgroup mattered because the cost of probes executing in application threads may not appear as a large CPU number on the separate instrumentation process.

The 25% result belongs to one workload and one configuration, not to eBPF instrumentation in general. The daemon was a high-throughput traffic-control component with a small baseline cost per request. A fixed amount of additional work looks proportionally larger on such a lean hot path than it would on an application performing heavier business logic. Still, the result is exactly why teams need workload-specific tests: an overhead percentage without the request profile, enabled features and saturation point is not a deployment decision.

One configuration detail was particularly important. STCLab reported that about two-thirds of the added CPU time came from header tracking, which it needed to read the W3C traceparent header and connect OBI spans to callers’ traces. Header tracking was off by default, yet it supplied much of the distributed-tracing value the team wanted. The expensive capability was not incidental; it was part of the reason to deploy the tool.

Sampling cannot erase probe cost

The case study also separates two costs that are frequently conflated. Sampling can reduce the volume of telemetry processed, exported and stored. It does not necessarily prevent instrumentation logic from observing each request before a sampling decision is applied. STCLab found that sampling did not solve its OBI overhead because the probes still ran for every request.

This distinction should shape observability capacity planning. Teams can use head or tail sampling to control backend ingest, storage and Collector load, but those savings do not automatically translate into lower application-side instrumentation cost. The relevant questions are where the sampling decision occurs and which work has already happened by then. A pipeline can become dramatically cheaper downstream while leaving the hot path essentially unchanged.

Tail sampling introduces a separate architectural issue. It needs enough of a trace to decide whether to retain it, so the sampling layer is stateful and must route related spans coherently. In STCLab’s gateway, spans were routed by trace ID so a complete trace landed on one Collector pod. Metrics and service graphs were generated before tail sampling, while another pipeline sampled traces for export. That ordering corrected an earlier problem in which RED metrics represented only retained traces rather than all served traffic.

For operators, this yields a simple rule: treat application instrumentation, telemetry transport, sampling and storage as four distinct cost centers. Optimization in one center should not be assumed to reduce the others.

Blind spots matter as much as overhead

Performance was only half of STCLab’s evaluation. The team also tested whether the signal described the failure modes it cared about. It paused the daemon with SIGSTOP, issued a request with a 10-second client timeout and resumed the process after 13 seconds. The client failed, but both OBI and the access log reported a 0.125 millisecond response with a 200 status because their timing began when the application read from the socket. They did not see the wait in the kernel accept queue.

That is a consequential boundary. An application-level request view can look healthy while a caller experiences a timeout. STCLab’s TCP tracer from Inspektor Gadget could see connections waiting as long as 12.6 seconds to be accepted, but only when the tracer was running. The lesson is not that one signal is wrong and another right. Each observes a different layer, and a production design needs enough overlap to expose disagreement between them.

The team adopted a tiered model. Cilium Hubble remained continuously enabled for L3/L4 network flows. OBI stayed on for selected lower-traffic workloads where it consumed about 1% of the workload CPU limit after a staging gate. Inspektor Gadget’s TCP tracing became a time-bounded incident tool. The hottest core instances remained without continuous OBI because the measured cost was too high.

This is a more credible pattern than enabling every available probe everywhere. Continuous coverage should favor signals with predictable cost and broad diagnostic value. More expensive or privileged tools can be reserved for targeted workloads, rollout windows and incidents.

A deployment gate for platform teams

Platform teams considering OBI or another eBPF-based instrumentor can turn the case study into a repeatable acceptance test.

  • Define the signal before the tool. Decide whether the requirement is request-level RED metrics, distributed trace continuity, network flow visibility, runtime data or deep incident inspection. Enabling features without a stated diagnostic goal expands cost and privilege without proving value.
  • Benchmark the real feature set. Test context propagation, header tracking, TLS visibility and protocol parsers exactly as they will run in production. A minimal default configuration is not an honest proxy for a deployment that needs richer context.
  • Measure the workload cgroup. Compare CPU time per request, tail latency, maximum sustainable throughput, throttling and restart behavior. Watching only the agent or DaemonSet can hide work performed in application threads.
  • Test near saturation. Overhead that seems harmless at average load can consume the margin needed during bursts. STCLab observed liveness failures and restarts before throughput simply flattened, which is a more dangerous failure mode than a linear slowdown.
  • Create adversarial failure tests. Pause processes, exhaust CPU quotas, delay accepts and force client timeouts. Then record which layer notices, what duration it reports and whether the evidence survives after the event.
  • Set a deployment tier and expiry. Classify instrumentation as always on, workload selective or incident only. Temporary expansion should have an automatic or reviewable end, rather than becoming permanent through inertia.

The same gate should include data safety. STCLab noted that OBI captured full query strings while its URLs could carry session tokens, so the Collector stripped those values before storage. Automatic discovery increases the need for attribute review because instrumentation can collect data that application owners never intended to export. Redaction belongs before durable storage, and ideally as close to collection as operationally practical.

The Collector topology also needs scrutiny

The production account highlights another risk: adding instrumentation to an unreliable aggregation pipeline can create convincing but false telemetry. STCLab’s service graph once showed 6,801 requests per second for an API whose SDK reported 26.2. Multiple Collector replicas were writing the same cumulative counter series without a writer label, leading Prometheus-style rate() calculations to interpret interleaved values as resets.

The fix was architectural. The team added stable writer labels, summed across writers and routed data according to the state each processor needed. It also moved span-derived metrics ahead of tail sampling. After the changes, span metric rates matched received spans within 1%.

Cardinality received the same treatment. Full object-storage URLs created 58,844 series for one service, about 20% of all active series. Replacing the full URL with a route reduced that service to roughly 1,200 series, and a cleanup reduced total active series by 35%. Instrumentation acceptance therefore cannot stop at CPU. It must validate semantic correctness, routing, label ownership and series growth.

What changes for cloud-native observability

OBI has reached a stable 1.0 release and supports a wide set of languages and protocols, making code-free instrumentation a realistic platform capability rather than a niche experiment. Its value is strongest where source-level integration is slow, inconsistent or impossible. But maturity raises the standard for adoption: teams should now manage it with the same performance budgets, rollout controls and security review applied to service meshes, sidecars and runtime agents.

STCLab’s experience points to a balanced operating model. Use eBPF to close visibility gaps quickly, but benchmark the features that provide the desired context. Keep cheap, broad signals on continuously. Limit higher-cost instrumentation by workload. Reserve deep, privileged diagnostics for short windows. Most importantly, test what each signal cannot see.

The headline number is 25%, but the durable lesson is methodological. Automatic instrumentation moves work out of application source code; it does not move that work outside the system. Platform teams that account for where the cost lands—and where observation begins and ends—can gain eBPF’s deployment speed without pretending the hot path is free.

Sources