QA
Senior LevelDocker & Deployment

How does OpenTelemetry eBPF Auto-Instrumentation trace microservices without code changes?

❓ Interview Prompt: Explain OpenTelemetry eBPF agent uprobes, auto-injected sidecar instrumentation, zero-code distributed tracing, and context propagation across services.

Traditional distributed tracing requires manual instrumentation — developers add SDK calls to each service. At scale, this is impractical and inconsistent. eBPF Auto-Instrumentation extracts traces without any code changes.

Two Approaches to Auto-Instrumentation:

#### 1. OpenTelemetry Operator (Sidecar Injection):

•
The OTel Operator watches pods with specific annotations.
•
Mutating webhook injects an init container that copies language-specific instrumentation agent into the pod.
•
For Node.js: injects @opentelemetry/auto-instrumentations-node.
•
For Java: injects the opentelemetry-javaagent.jar via JAVA_TOOL_OPTIONS.
•
Requires container restart; works at language runtime level.

#### 2. Beyla / Coroot eBPF (Zero-Restart):

•
eBPF programs attach to uprobes on HTTP/gRPC library functions at the binary level.
•
Extracts trace spans from syscall-level HTTP headers without modifying application code.
•
Works with compiled binaries (Go, Rust) where language-level agents don't apply.
•
No application restart required.

Context Propagation:

Auto-instrumented services must propagate W3C TraceContext (traceparent) headers. eBPF agents automatically add/read these headers at the HTTP client/server boundaries.

Code Implementation Example

yaml
# OTel Operator: auto-instrument Node.js pods via annotation
# First install OTel Operator via Helm
# helm install opentelemetry-operator open-telemetry/opentelemetry-operator

# Instrumentation CRD: defines how to instrument Node.js apps
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
  name: nodejs-instrumentation
spec:
  exporter:
    endpoint: http://otel-collector:4317  # OTLP gRPC endpoint
  
  propagators:
    - tracecontext    # W3C TraceContext headers
    - baggage
  
  nodejs:
    image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:latest
    env:
      - name: OTEL_SERVICE_NAME
        valueFrom:
          fieldRef:
            fieldPath: metadata.labels['app']
---
# Pod annotation triggers automatic sidecar injection
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  template:
    metadata:
      annotations:
        instrumentation.opentelemetry.io/inject-nodejs: "nodejs-instrumentation"
        # No code changes needed! OTel operator injects the agent automatically
💡OTel Operator injects Node.js agent via init container based on pod annotation — zero code changes for distributed tracing.
🎯 Interview Key Takeaway

OTel Operator auto-injects language agents via mutating webhook (annotation-based); eBPF agents (Beyla) instrument at syscall level without any restart. Both enable zero-code distributed tracing.

#OpenTelemetry#eBPF#Auto-Instrumentation#Distributed Tracing#Observability#Senior
Back to all Docker & Deployment Questions→

More Docker & Deployment Interview Questions

Beginner LevelDocker & Deployment

How do Docker Multi-Stage Builds minimize image size and improve security?

Beginner LevelDocker & Deployment

What is the difference between a Docker Container and a Virtual Machine (VM)?

Beginner LevelDocker & Deployment

What is the difference between a Docker Image and a Docker Container?