Root Cause Analysis

Correlating Logs, Metrics, and Deploys for Faster RCA

10 min read By Marcus Chen
Abstract visualization of three data streams converging to reveal a root cause

The fundamental challenge of root cause analysis in distributed systems is that the evidence for a single cause is spread across multiple telemetry sources that don't talk to each other. A deploy event lives in your CI/CD system. The metric anomaly lives in Prometheus or Datadog. The log signature lives in your log aggregation platform. When an alert fires, the on-call engineer has to manually open three different tabs, three different query interfaces, and mentally construct the correlation that these tools don't provide natively.

This is the core problem we set out to solve with Devtract's correlation engine. Not because the individual tools are bad, but because the act of correlation is itself where most diagnostic time disappears.

Why Three Sources, Not One

You might wonder why you need all three. If metrics are anomalous, can't you just look at metrics to find the cause? If the logs show an error, isn't that enough?

In practice, each source gives you a different dimension of what happened, and any single one is usually insufficient for a complete RCA.

Metrics tell you that something changed in system behavior: latency went up, error rate increased, memory crossed a threshold. They're excellent for detection and for quantifying impact. They're poor at explaining mechanism because they aggregate behavior rather than recording discrete events.

Logs tell you what a specific process did at a specific moment: a request was rejected, a connection failed, a timeout was thrown. They're excellent for tracing a specific failure path. They're poor at showing system-wide patterns because the volume makes scanning for signals difficult without specific search terms.

Deploy events tell you when something in the system intentionally changed: code, configuration, infrastructure. They're the single most high-signal RCA input when a deploy correlates with anomaly onset, but they're often not surfaced in the same context as metrics and logs. Engineers frequently forget to check the deploy log, especially on services they don't own.

All three together give you a causal narrative: a deploy happened (change), the metric shifted at that time (impact), and here's the log signature that explains the mechanism (path). Remove any one of the three and the RCA story has a gap.

A Concrete Scenario: The Three-Service Deploy

Let's walk through a realistic incident type that illustrates the correlation problem. A platform engineering team deploys an update to a shared auth library used by their API gateway, a user service, and a notification service. The deploy is a minor dependency bump and goes out without incident flags.

Forty minutes later, the checkout flow starts throwing elevated 500 errors. An alert fires on the checkout service's error rate.

The on-call engineer acknowledges the page and opens the checkout service dashboard. Metrics show HTTP 500s started at 14:47. The checkout service itself has no recent deploy. The on-call opens the logs and sees AuthTokenValidationException: signature algorithm mismatch in the checkout service logs. That exception wasn't present before 14:47.

Now the on-call has to figure out why the auth token validation is failing. The exception points to the auth library. Did the auth library change? The on-call needs to check deploy logs for the auth service, the API gateway, and any other service that might have updated the library. This is where the diagnostic gap widens: moving from "I know the symptom" to "I know the cause" requires looking at deploy history across three services, none of which is the service that alerted.

With deploy correlation, this path is shortened: the correlation engine sees the auth library update in the API gateway and user service deploys at 14:30 and automatically surfaces those deploys as candidates in the RCA view when the checkout service alert fires. The on-call doesn't need to know to go look there. The correlation does the lookup.

Building a Correlation Model: What's Actually Hard

The technical challenge in correlating across these three sources is that they have different time resolution, different cardinality, and different causal relationship structures.

Time Resolution Mismatch

A Prometheus scrape interval is typically 15-60 seconds. A log entry has millisecond precision. A GitHub Actions deploy event has a start time and an end time but the artifact propagation to running pods happens asynchronously over minutes. Correlating a metric anomaly at 14:47:32 with a deploy that "completed" at 14:30 but was fully rolled out by 14:44 requires reasoning about the deploy's effective time window, not just its timestamp.

We handle this in Devtract by modeling deploys as ranges rather than points. The correlation window for a deploy is from the deployment start time to start time plus a configurable propagation delay, defaulting to 15 minutes but adjustable per service based on historical rollout duration data.

Cardinality Problems in Logs

A high-traffic service can produce 50,000 log lines per minute during an incident. Parsing all of them to find patterns that correlate with a metric anomaly requires either a very fast pattern-matching pipeline or a way to precompute log signatures at ingestion time. We chose a hybrid: at ingestion, we tokenize log lines and group them into signature clusters. During an incident, we compare the current signature distribution against the pre-incident baseline distribution and surface signatures that appeared or increased significantly. This is not novel NLP, but the operationalization of it in a real-time correlation pipeline is where a lot of our engineering time has gone.

Causal Direction Is Not Obvious

Correlation between a deploy and a metric anomaly doesn't prove causation. Two different services might both have deployed around the same time. A metric spike might be driven by a traffic surge unrelated to any deploy. The RCA engine needs to rank hypotheses by plausibility, not just list correlations. Our approach combines temporal proximity, service dependency graph proximity (did the deploy touch a service in the dependency chain of the alerting service?), and historical pattern matching (has this deploy artifact previously correlated with this anomaly signature?) to produce a ranked hypothesis list rather than a flat correlation list.

The Practical Workflow Improvement

When the three sources are correlated in a unified view, the RCA workflow changes from a multi-tab investigation to a single-screen diagnosis. The on-call opens the incident context in Devtract and sees: the alert details, the metric anomaly timeline, the log signature that appeared at the same time, and the deploy event in the dependency path that preceded both. The hypothesis is surfaced rather than constructed.

This doesn't eliminate the need for human judgment. A hypothesis is a starting point, not a verdict. The on-call still needs to verify that the proposed cause actually explains the behavior. But starting from a structured hypothesis is fundamentally different from starting from a blank alert and three separate tools. The former is confirmation and verification work. The latter is search and synthesis work. The former takes minutes. The latter takes tens of minutes, or hours if the signal is ambiguous.

What to Instrument for Better Correlation

If you want to get more value from cross-source correlation, the most impactful investment is standardizing deploy event emission. Many teams have metrics and logs flowing into a single platform but deploy events are scattered across GitHub webhooks, Jenkins notifications, Terraform state change events, and Argo CD sync events. If those events aren't normalized into a common schema with service name, artifact version, deploy start time, and deploy end time, you can't do reliable deploy correlation.

We recommend a simple internal deploy event standard: a single webhook payload emitted by your CD system at deploy start and deploy complete, containing service name, environment, git sha, deployer identity, and timestamp. Even if you're manually cURL-ing this to an internal endpoint during early tooling, the practice of emitting consistent deploy events pays dividends far beyond correlation. It also powers your deployment frequency and change failure rate SLO tracking.

The second investment is structured logging. Log lines that are free text blobs require NLP to cluster. Log lines that are structured JSON with a stable error_code or event_type field can be correlated trivially. If your services log structured JSON with consistent field naming, your log-to-metric correlation quality improves dramatically because you can query by specific event types rather than regex-matching raw text.

Neither of these is a Devtract-specific requirement. They're just good observability hygiene that pays off regardless of what tooling you use for correlation. But they're also the thing that, when we talk to teams about why their RCA process is slow, turns out to be missing more often than not.