ILLUSTRATIVE USE CASE — NOT A CUSTOMER CASE STUDY
Walkthrough: Investigating p99 Latency Regressions on Kubernetes with OpenTelemetry
An illustrative walkthrough of how a platform team could trace p99 latency regressions after deploys with OpenTelemetry, trace-log correlation and SLO burn alerts.
- Scenario
- A platform team runs around thirty microservices on Kubernetes. After most deploys, p99 latency on customer-facing APIs creeps up for hours before anyone notices, and each investigation turns into a long call where engineers compare dashboards from different tools and guess which service changed.
- Industry
- B2B SaaS platform running microservices on Kubernetes
- Problem
- Our p99 latency regresses after deploys and we cannot tell which service or change caused it without hours of guesswork.
- Related product
- aiAxonIQ
This walkthrough describes a realistic, composite situation to explain an approach. It is not an account of a real customer, and it reports no achieved results.
On this page
This walkthrough describes a hypothetical platform team and the steps a team like this could take to make latency regressions explainable. The organisation, its services and its numbers are invented for illustration. Nothing here describes a real customer or a measured outcome.
Background
The team in this scenario runs the shared Kubernetes platform for a B2B SaaS product: roughly thirty services written in Go, Java and Node.js, deployed several times a day through a CI pipeline and an in-cluster GitOps controller. Customers reach the product through an API gateway, and most requests fan out to between three and eight internal services plus a PostgreSQL database and a message queue.
Each service team owns its own code, alerts and dashboards. The platform team owns the cluster, the deployment pipeline and, informally, every incident that crosses a service boundary, which in practice means most latency problems.
Business challenge
Enterprise customers have contractual response-time expectations on a handful of API endpoints. Average latency looks fine almost all the time. The p99, the slowest one percent of requests, is what customers feel during bulk operations and integrations, and it regresses after deploys more often than anyone likes.
When it does, the cost is not only the slow requests themselves. It is the engineering time spent on long investigation calls, the deploys frozen while people argue about which change caused it, and the account managers fielding questions they cannot answer. A team like this needs to answer one question quickly: which service, which change, which code path?
Existing situation
Telemetry exists, but it is fragmented:
- Metrics come from Prometheus. Each service exposes request duration histograms, but label names and bucket boundaries differ between teams, so a cross-service p99 view does not exist.
- Logs go to a separate log store. Some services log a request ID; most do not, and none log a trace ID.
- Traces exist for two services that adopted a vendor SDK years ago. The other services are invisible, so a trace stops at the first hop.
- Alerts fire on static thresholds such as "p99 above 800 ms for 10 minutes". They are either noisy at peak or silent during slow, steady regressions.
- Deploy history lives in the CI system and the GitOps controller. Nobody overlays it on latency graphs.
The typical investigation goes like this: someone notices a slow graph, posts in the incident channel, and four teams each check their own dashboards and report that their service "looks normal". Without request-level evidence that crosses service boundaries, nobody can prove otherwise.
Why a change was needed
Three things made the status quo untenable for a team like this.
First, averages and per-service views hide tail latency. A regression in one downstream call that affects only a subset of requests can move the end-to-end p99 while every individual service's median looks healthy.
Second, static thresholds do not map to what customers experience. The question that matters is "are we consuming our reliability budget faster than we can afford?", and threshold alerts cannot answer it.
Third, the link between a deploy and a regression was manual. Without deploy markers and version attributes on telemetry, correlating "latency went up" with "service X shipped version Y" relied on someone remembering.
Approach and implementation
The approach is vendor-neutral by design: instrument with OpenTelemetry, route everything through the OpenTelemetry Collector, and make trace context the thread that ties metrics, logs and deploys together. Any backend that accepts OTLP can sit behind it.
A short implementation plan for a team like this:
- Agree on conventions first. Adopt OpenTelemetry semantic conventions for resource attributes:
service.name,service.version,deployment.environment, and Kubernetes attributes added by the Collector. Agree on one histogram definition for request duration. - Deploy the Collector in two tiers. Run an agent Collector as a DaemonSet on every node to receive OTLP from pods and attach Kubernetes metadata, and a gateway Collector Deployment that batches, processes and exports to the backend.
- Instrument the edge and the critical path first. Start with the API gateway and the services behind the three most contractually sensitive endpoints, using auto-instrumentation where the language supports it, so trace context propagates through HTTP and gRPC calls via the W3C
traceparentheader. - Put trace IDs in logs. Configure each service's logging library (or the OTel logs bridge) to write
trace_idandspan_idon every log record emitted inside a request. - Annotate deploys. Have the pipeline set
service.versionfrom the image tag and emit a deploy event, so every span and metric can be grouped by version. - Define SLOs and burn-rate alerts. Replace static p99 thresholds on the key endpoints with latency SLOs, for example "99% of requests to this endpoint complete under a target", and alert on error-budget burn rate with a fast and a slow window, as the Google SRE Workbook describes.
- Expand service by service. Add the remaining services in order of how often they appear in slow traces, and retire the vendor SDKs once their spans are covered.
Solution architecture
The target architecture looks like this:
Pods (Go / Java / Node.js services, OTel SDK + auto-instrumentation)
│ OTLP (traces, metrics, logs with trace_id)
▼
Agent Collector ── DaemonSet, one per node
│ k8sattributes processor adds pod, namespace, deployment
▼
Gateway Collector ── Deployment, horizontally scaled
│ batch, memory_limiter, optional tail sampling
│ OTLP export
▼
Observability backend
├─ Trace store ── spans grouped by service.version
├─ Metrics ── PromQL over duration histograms
├─ Logs ── each log line links to its trace
├─ SLOs ── burn-rate alerts → on-call rotation
└─ Deploy events ── CI/GitOps markers on every graph
Existing Prometheus ── remote_write ──▶ same backend (during migration)
The pieces that matter for latency investigation are the joins. A burn-rate alert on an endpoint leads to the slowest traces for that endpoint in the alert window. A slow trace shows which span holds the time and which service.version produced it. The span links to the log lines written during that request. The deploy marker shows when that version rolled out. Each step is one click or one query rather than a conversation.
A team could assemble this from open-source components, or use a platform built around OpenTelemetry. As one example of the latter:
aiAxonIQ is an OpenTelemetry-native observability platform that keeps the spans you send rather than sampling them away, stores logs and metrics together (metrics arrive via Prometheus remote_write or OTLP and are queried with PromQL), and lets a log line open its trace. It supports SLOs and error budgets with burn-rate alerting, on-call schedules and escalation, and an AI investigation feature that proposes root-cause hypotheses citing a trace, log or deploy, using the model provider you connect. Whatever backend a team chooses, the architecture above stays the same, because the instrumentation and the Collector are vendor-neutral.
What to measure
Because this is an illustrative scenario, there are no results to report. These are the measures a team like this would track to know whether the change is working, and how to collect each one.
- Trace coverage of critical endpoints. The share of requests to the key endpoints whose traces include spans from every service on the path. Measure it by sampling traces for each endpoint and checking for missing hops, and track it weekly until gaps close.
- Log-to-trace link rate. The proportion of log records emitted inside requests that carry a valid
trace_id. A simple query in the log store, grouped by service, shows which teams still need to update their logging configuration. - Time to identify the responsible change. For each latency incident, record when the alert fired and when the team named the service and version responsible. Keep it in the incident template so the number comes from real incidents, not estimates.
- SLO compliance and error-budget consumption per endpoint, per 28- or 30-day window, as reported by the SLO tooling.
- Alert quality. Count burn-rate pages that led to action versus those closed as noise. If most pages are noise, the windows or thresholds need tuning.
- Deploy-linked regressions caught before customers report them. Tag each latency incident with how it was detected: alert, internal user or customer ticket.
Set a baseline for each measure in the first weeks, before conventions are fully adopted, so later comparisons are honest.
Lessons learned
These are the lessons a team like this would likely encounter, drawn from common OpenTelemetry rollout patterns rather than from a specific deployment.
- Conventions beat coverage. Thirty services emitting inconsistent attributes are harder to query than ten services emitting consistent ones. Settle
service.name,service.versionand the duration histogram first. - Context propagation breaks at the edges. Message queues, async workers and third-party SDKs often drop trace context. Check every hop on the critical path explicitly rather than assuming auto-instrumentation covered it.
- Start the Collector small. A memory limiter and batch processor on the gateway prevent most early problems. Add tail sampling only if storage or cost forces it.
- Retire the old alerts deliberately. Running static thresholds alongside burn-rate alerts for a few weeks builds trust; leaving both forever doubles the noise.
- Deploy markers are cheap and disproportionately useful. They turn "what changed?" from a question into an overlay.
For the fundamentals behind this walkthrough, see OpenTelemetry explained and the Kubernetes incident triage guide. The observability implementation checklist turns the plan above into trackable tasks.
Sources and references
Related resources
Keep reading
Enterprise Observability Outlook
Where enterprise observability is heading: OpenTelemetry maturity by signal, cost pressure, consolidation, profiling, LLM telemetry, AI-assisted investigation and SLOs.
· 10 min read
aiAxonIQ vs Datadog: Comparing Two Approaches to Observability
A broad, managed observability suite or an OpenTelemetry-native platform you can self-host? Compare Datadog and aiAxonIQ on data model, cost drivers and AI.
· 8 min read
Modern Observability: Logs, Metrics and Distributed Tracing Explained
What logs, metrics and distributed traces each tell you, where each one falls short, and how to connect them so incidents are diagnosed in minutes, not hours.
· 7 min read
Trace Sampling Is a Business Decision, Not a Config Default
Why the trace sampling rate is a cost and risk trade-off that engineering leadership should own explicitly, instead of a number inherited from an SDK default.
· 6 min read
Stay Ahead of What Matters.
Practical guides on observability & cloud and more, delivered to your inbox.