Interview Prep/Monitoring & Observability/Tracing and OpenTelemetry

How do you instrument a Kubernetes cluster so every new pod gets tracing automatically?

IntermediateScenarioTracing and OpenTelemetry
Answer

Situation read → You want platform-level defaults, not per-team effort.

What I'd do →

  1. Install the OpenTelemetry Operator (needs cert-manager).
  2. Create an Instrumentation resource with exporter endpoint, propagators and sampler.
  3. Teams opt in with an annotation such as instrumentation.opentelemetry.io/inject-java: "true" (also -python, -nodejs, -dotnet, -go).
  4. Use the k8sattributes processor in the Collector to add pod, namespace and deployment metadata.
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata: {name: default}
spec:
  exporter: {endpoint: http://otel-collector.observability:4317}
  propagators: [tracecontext, baggage]
  sampler: {type: parentbased_traceidratio, argument: "0.1"}

Why → Annotation-based injection gives tracing without image or code changes.

Interview tip → Mention that Go injection uses eBPF and needs elevated privileges.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing and OpenTelemetry