Skip to main content
🎤 Luca Berton is speaking at Red Hat Summit & KubeCon EU 2026!Learn more →
Back to Blog

Root Cause Analysis for DevOps

Apply Root Cause Analysis to DevOps incidents. The 5 Whys, fishbone diagrams, blameless postmortems, and automated RCA tooling.

Luca BertonMarch 30, 20263 min read

Root Cause Analysis (RCA) is a structured method for finding the true cause of a problem — not just the symptoms. In DevOps, RCA is the difference between fixing an outage once and firefighting the same issue every month.

Why RCA Matters in DevOps

Every production incident has a surface cause and a root cause:

  • Surface cause: "The database ran out of disk space"
  • Root cause: "We have no disk usage alerts, no automated cleanup, and no capacity planning process"

Fixing the surface cause means you will be paged again. Fixing the root cause prevents the entire class of failure.

The 5 Whys Method

The simplest RCA technique. Keep asking "why" until you reach the systemic cause:

Incident: API returned 500 errors for 45 minutes

  1. Why did the API return 500s? → The application crashed due to OOM (Out of Memory)
  2. Why did it run out of memory? → A new feature had a memory leak processing large uploads
  3. Why wasn't the leak caught? → No memory profiling in the CI pipeline
  4. Why was there no profiling? → The team didn't have performance testing standards
  5. Why no standards? → Performance testing was never prioritized in sprint planning

Root cause: Missing performance testing in the development process Action items: Add memory profiling to CI, set memory limits in Kubernetes, create performance testing guidelines

Related Course

Master this topic with hands-on labs

Go beyond reading — build real projects in sandboxed environments with expert video guidance.

Browse Courses →

Fishbone Diagram for Infrastructure

Organize potential causes by category:

                    ┌─ Code: Memory leak, race condition
                    ├─ Config: Wrong env vars, bad limits
Incident ───────────├─ Infrastructure: Disk full, network partition
(500 errors)        ├─ Dependencies: Database down, API timeout
                    ├─ Process: No review, no testing
                    └─ People: Fatigue, knowledge gap

For DevOps incidents, these categories often apply:

CategoryExample Causes
CodeMemory leaks, unhandled exceptions, race conditions
ConfigurationWrong environment variables, expired secrets, bad resource limits
InfrastructureDisk full, node failure, network partition, DNS issues
DependenciesThird-party API down, database failover, certificate expiry
ProcessNo code review, missing tests, incomplete runbooks
MonitoringNo alerts, wrong thresholds, alert fatigue

Blameless Postmortems

The most important RCA practice in DevOps is the blameless postmortem. The goal is to understand what happened, not who to blame.

Postmortem Template

markdown
# Incident Postmortem: [Title]
**Date**: 2026-04-10
**Duration**: 45 minutes
**Severity**: P1
**Author**: [Name]

## Summary
Brief description of what happened and impact.

## Timeline
- 14:00 UTC — Monitoring alert: API error rate > 5%
- 14:05 UTC — On-call engineer acknowledged
- 14:12 UTC — Identified OOM kills in pod logs
- 14:20 UTC — Scaled up memory limits as mitigation
- 14:30 UTC — Identified memory leak in upload handler
- 14:45 UTC — Hotfix deployed, error rate normalized

## Root Cause
Memory leak in the file upload handler introduced in PR #342.
Large files (>100MB) were buffered entirely in memory instead
of streaming to object storage.

## Contributing Factors
- No memory profiling in CI pipeline
- Resource limits set too high (4Gi) masking gradual growth
- No load testing with large file uploads

## Action Items
| Action | Owner | Priority | Status |
|---|---|---|---|
| Add memory profiling to CI | @alice | P1 | TODO |
| Implement streaming uploads | @bob | P1 | TODO |
| Set realistic memory limits | @alice | P2 | TODO |
| Add large file load test | @charlie | P2 | TODO |
| Review all upload handlers | @bob | P3 | TODO |

## Lessons Learned
- What went well: Fast detection (5 min), clear escalation path
- What went poorly: No runbook for OOM, took 20 min to identify root cause
- Where we got lucky: Only affected uploads, not core API

Automated RCA Tooling

Modern DevOps teams use tools to accelerate root cause analysis:

Log Correlation

bash
# Find all errors in the timeframe
kubectl logs deployment/api --since=1h | grep -i error

# Correlate with resource metrics
kubectl top pods --sort-by=memory

# Check recent deployments
kubectl rollout history deployment/api

Prometheus Queries

promql
# Memory usage spike
rate(container_memory_usage_bytes{pod=~"api.*"}[5m])

# Error rate correlation
rate(http_requests_total{status=~"5.."}[5m])
/ rate(http_requests_total[5m])

# CPU throttling
rate(container_cpu_cfs_throttled_seconds_total[5m])

Automated Runbooks

Combine detection with analysis:

yaml
# PagerDuty/Opsgenie runbook
name: API High Error Rate
triggers:
  - alert: APIErrorRate > 5%
steps:
  - check: "kubectl get pods -l app=api | grep -v Running"
  - check: "kubectl top pods -l app=api --sort-by=memory"
  - check: "kubectl logs -l app=api --tail=50 | grep -c ERROR"
  - check: "kubectl rollout history deployment/api | tail -3"
  - action: "If OOM → kubectl rollout restart deployment/api"
Stay Updated

Get weekly IT automation tips

Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.

Subscribe Free →

RCA Best Practices for DevOps Teams

  1. Start within 48 hours — memories fade, logs rotate
  2. Blame the system, not people — "The process allowed this" not "Alice broke it"
  3. Require action items — every postmortem must produce concrete improvements
  4. Track completion — action items without follow-up are useless
  5. Share publicly — postmortems are learning opportunities for the whole org
  6. Review patterns — monthly review of all incidents reveals systemic issues
  7. Automate detection — every RCA should improve monitoring

Core Principles of RCA

  • Look beyond symptoms: The first explanation is rarely the root cause
  • Seek systemic fixes: Prefer process/tooling changes over one-off patches
  • Multiple contributing factors: Most incidents have 3-5 contributing causes
  • Prevention over detection: Catching problems before production is cheaper
  • Continuous improvement: Each incident makes the system more resilient

What's Next?

Effective RCA requires solid infrastructure observability. Our Docker Fundamentals and MLflow for Kubernetes MLOps courses teach you to build observable, well-monitored systems from the start. The first lesson of each course is free. -e ---

Ready to go deeper? Explore our hands-on DevOps courses — practical labs covering Docker, Ansible, Terraform, and more.

Ready to learn by doing?

Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.

Share this article
LB
Luca Berton

Docker Captain, IT automation expert, Red Hat Summit & KubeCon speaker. Building hands-on education for DevOps engineers at CopyPasteLearn.

Related Articles

Explore topics

Browse more articles on the topics covered here.