Skip to main content

eBPF · Service Mesh · Kubernetes

eBPF vs Sidecar: Where Service Mesh Telemetry Should Come From

Envoy sidecars, Istio ambient, Cilium with Hubble and socket-level eBPF agents all produce service telemetry. What each sees, what it costs, how to choose.

aiAxonIQ Team, Engineering at aiAxonIQ

Nov 25, 20269 min read

For years the answer to "how do we get golden signals for every service without touching code" was a service mesh. Put an Envoy proxy next to every pod, route all traffic through it, and the proxy reports request rate, errors and latency for free. The bill came later, in CPU and memory reserved on every pod, an extra hop on every request, and a control plane someone has to upgrade. eBPF changed the question. The kernel already sees every socket, so the debate is now eBPF vs sidecar: does telemetry have to come from a proxy at all?

This post compares the four models you are likely to meet in a Kubernetes cluster today: classic Istio sidecars, Istio ambient mode, Cilium with Hubble, and socket-level eBPF agents. For each one it covers what is actually measured, what it costs, and where it goes blind. If you want the kernel mechanics first, read eBPF observability explained; this post assumes them.

The sidecar model: a proxy that sees everything it forwards

In Istio's sidecar mode, an injected istio-proxy container (Envoy) runs in every application pod, and iptables rules (or the Istio CNI plugin) redirect the pod's inbound and outbound traffic through it. Because the proxy terminates and re-originates each connection, it has full Layer 7 context for HTTP, HTTP/2 and gRPC. Istio's standard metrics come from it:

  • istio_requests_total, istio_request_duration_milliseconds, istio_request_bytes and istio_response_bytes for HTTP and gRPC.
  • istio_request_messages_total and istio_response_messages_total for gRPC streams.
  • istio_tcp_sent_bytes_total, istio_tcp_received_bytes_total, istio_tcp_connections_opened_total and istio_tcp_connections_closed_total for everything else.

Each series carries source_workload, destination_workload, response_code, the mTLS identity and a reporter label saying whether the client or server proxy recorded it. Having both sides report the same call is useful: a gap between client-side and server-side latency is time spent on the network or queued in a proxy.

The sidecar also sees things that only exist because the mesh does them: retries, timeouts, circuit breaking and fault injection. If the mesh retried a request twice before returning a 200, the proxy knows, and nothing outside it does.

Envoy can emit trace spans for each hop, but it cannot stitch them into one trace on its own. When a request enters a service and that service makes outbound calls, only the application knows which outbound call belongs to which inbound request. The application must copy the trace headers (traceparent, or the B3 headers) from one to the other. A mesh without application-side propagation produces disconnected two-span fragments, not distributed traces.

What sidecars cost

The cost has three parts, and they scale differently.

  • Resources per pod. Every pod runs its own proxy, so CPU and memory requests multiply by pod count, whether the pod is busy or idle. Istio's own performance page reports that in Istio 1.24, at 1,000 HTTP requests per second with 1 KB payloads, a sidecar with two worker threads used about 0.20 vCPU and 60 MB of memory. Proxy memory also grows with the amount of mesh configuration it holds, which is why large meshes scope configuration per namespace.
  • Latency. Every request passes through two extra proxies, the client's and the server's. Istio publishes P90 and P99 comparisons against a no-mesh baseline on the same page, and notes that telemetry filters (metrics, logging and tracing) have a moderate impact on latency.
  • Operations. Sidecars are injected at pod creation, so upgrading the mesh data plane means restarting every workload. Startup ordering matters (the app must not send traffic before the proxy is ready), and Jobs historically never completed because the proxy kept running. Kubernetes native sidecar containers, which Istio can use, address the last two.

None of this makes sidecars wrong. It makes them expensive as a telemetry source alone. If you run Istio for mTLS and traffic policy anyway, the metrics are close to free. If you would run it only for metrics, the trade is harder to justify.

Istio ambient: split the proxy in two

Istio's ambient mode removes the per-pod proxy. Its data plane has two layers:

  • ztunnel, a per-node proxy written in Rust, handles mTLS, L4 authorization and L4 telemetry for every meshed pod on the node. It deliberately does not parse HTTP. From ztunnel alone you get the istio_tcp_* metrics: bytes and connections between workloads, with identities, but no request counts, status codes or paths.
  • Waypoint proxies are Envoy deployments that you add per namespace or service account when you need L7. Traffic for those destinations is routed through the waypoint, which produces istio_requests_total and the other HTTP metrics, plus L7 policy and routing.

The resource picture changes accordingly. Istio's 1.24 figures put a ztunnel at about 0.06 vCPU and 12 MB under the same load as the sidecar figure above, and a waypoint at about 0.25 vCPU and 60 MB. The difference is that you run one ztunnel per node and waypoints only where you need L7, rather than a full proxy in every pod.

The telemetry trade-off is explicit: without a waypoint, ambient gives you an encrypted, identity-aware L4 map of the cluster, not golden signals. Namespaces where you need request-level metrics need a waypoint, and the waypoint adds a hop of its own.

Cilium and Hubble: eBPF in the dataplane

Cilium replaces kube-proxy and the CNI's packet path with eBPF programs. Because every packet already passes through Cilium's programs, flow visibility comes with the network: Hubble records each flow with source and destination identity, verdict (forwarded or dropped) and drop reason. hubble observe streams them, and Hubble's Prometheus metrics include hubble_flows_processed_total, hubble_drop_total, and TCP and DNS metrics. For network questions, such as which policy dropped this connection or which pod is resolving that domain, this is excellent and costs no proxy at all.

L7 is a different story, and it is the detail most eBPF vs sidecar comparisons skip. Cilium's Layer 7 visibility works by redirecting matching traffic to an Envoy proxy, one per node rather than one per pod, either inside the Cilium agent or as the cilium-envoy DaemonSet. You opt in with a CiliumNetworkPolicy that has L7 rules, which also enforces them, so enabling HTTP visibility for a port means writing policy for that port. Once enabled, hubble_http_requests_total and hubble_http_request_duration_seconds report request metrics. So Cilium's L7 telemetry is eBPF for steering and a shared proxy for parsing.

Cilium encrypts traffic between nodes with WireGuard or IPsec rather than per-workload TLS sessions in a proxy. Hubble flows can contain URLs, headers and query strings, so turn on the --hubble-redact-* options before sending L7 flows anywhere they might be stored.

Socket-level eBPF agents: no proxy in the path

The fourth model does not touch the traffic path at all. An agent running as a DaemonSet attaches kprobes to socket send and receive functions and uprobes to TLS libraries, copies request and response bytes out of the kernel, and reconstructs HTTP, gRPC and database calls in user space. There is no redirect and no extra hop. If the agent stops, traffic carries on and only telemetry is lost.

This model sees protocols a mesh treats as opaque TCP. A sidecar can report bytes to PostgreSQL; a socket agent can report the query latency and error rate. It also covers pods that are not meshed, including the ones in kube-system and the third-party images nobody wants to inject.

It does not see what a mesh does on the wire: retries, timeouts and routing decisions belong to a proxy that does not exist here. Its cost scales with request rate rather than pod count, so a node full of idle pods costs almost nothing, while a node handling heavy traffic costs more.

What each model sees

The differences that decide most evaluations:

  • L7 request metrics. Sidecars: yes, for HTTP, HTTP/2 and gRPC. Ambient: only behind a waypoint. Cilium: only on ports with L7 policy. Socket eBPF: yes, plus database and cache protocols.
  • Mesh mTLS. Here the proxy is the encryption layer, so it sees plaintext before encrypting. A socket agent also sees plaintext, because the application writes unencrypted bytes to its socket and the mesh encrypts them later. Mesh mTLS does not blind kernel telemetry.
  • Application-level TLS. If the application terminates TLS itself, a sidecar sees an opaque TCP stream and falls back to TCP metrics. A socket agent can still read plaintext through uprobes on the TLS library, where it supports that library; statically linked Go binaries are the hard case.
  • Retries and policy. Only a proxy (sidecar, waypoint or Cilium's Envoy) knows about retries, timeouts and authorization decisions. Cilium additionally reports L3 and L4 policy drops from the kernel.
  • Unmeshed workloads. Sidecars and ambient only see pods enrolled in the mesh. Cilium and socket agents see every pod on the node.
  • Failure mode. A proxy in the path can fail requests. An observer outside the path can only lose data.

Combining either with OpenTelemetry SDKs

Neither proxies nor kernel probes know your business logic, so the end state for important services is the same in every model: OpenTelemetry SDKs (or the agents the OpenTelemetry Operator injects) for custom spans and attributes, with W3C traceparent propagation so every hop joins one trace.

If you keep Istio, point its tracing at an OpenTelemetry Collector so proxy spans and SDK spans share a trace ID and a backend. Define the provider in meshConfig:

meshConfig:
  extensionProviders:
    - name: otel-tracing
      opentelemetry:
        service: otel-collector.observability.svc.cluster.local
        port: 4317

Then enable it with the Telemetry API, keeping the sampling rate in line with what your SDKs use:

apiVersion: telemetry.istio.io/v1
kind: Telemetry
metadata:
  name: mesh-default
  namespace: istio-system
spec:
  tracing:
    - providers:
        - name: otel-tracing
      randomSamplingPercentage: 10

Whichever source you use for network-level signals, route it through the same Collector as your SDK telemetry. Our comparison of Collector and direct SDK export explains why a Collector in the middle pays for itself once there is more than one source.

Choosing

  • You need mTLS, traffic policy and canary routing. Run a mesh, and take its telemetry. Ambient is worth evaluating if per-pod overhead is the main complaint about sidecars, with waypoints only where you need L7.
  • You need network policy and flow visibility. Cilium with Hubble answers connectivity and drop questions better than anything else here. Add L7 policy selectively, knowing it enforces as well as observes.
  • You need golden signals everywhere, without a mesh. A socket-level eBPF agent covers every pod, including databases and caches, without changing the traffic path.
  • You need to explain a slow checkout. None of the above alone. That takes SDK spans on the services that matter, joined to whatever network-level source you run.

These are not exclusive. A common combination is Cilium as the CNI, a socket-level agent for service golden signals, and SDKs on the revenue path, with no mesh at all until mTLS between workloads becomes a requirement.

Where axonIQzerocode fits

aiAxonIQ's axonIQzerocode eBPF instrumentation is the socket-level model described above. It runs as one DaemonSet installed with Helm, attaches kprobes and uprobes to socket paths, reconstructs HTTP/1.1, HTTP/2, gRPC, PostgreSQL, MySQL and Redis calls, and builds a service-to-service map from real connections without Envoy sidecars. It needs Linux 5.4 or later with BTF, enriches every signal with pod, namespace, container and node labels, and exports OTLP, so it sits alongside an existing mesh or Cilium install and correlates with OpenTelemetry SDK spans where they exist.

Put this into practice with aiAxonIQ axonIQzerocode.

More articles