</>CodeWithKarani
All of DevOps & Cloud
DevOps & Cloud

Observability

Logs, metrics, traces and alerts you can actually act on.

13 articles

DevOps & Containers9 min read

CrashLoopBackOff with no logs: a systematic way to find the real cause

CrashLoopBackOff is a retry policy, not a diagnosis. Four categories, two commands to tell them apart, and why three of the four are not application bugs at all.

Read
DevOps & Containers8 min read

The Shared /health Endpoint That Kills Healthy Kubernetes Pods

Pointing liveness and readiness at one /health endpoint that checks your database turns a 30 second blip into a cluster-wide crash loop. Here is the correct split.

Read
DevOps & Containers8 min read

Kubernetes HPA Not Scaling: The Conditions You Are Not Reading

Your HPA reports an unknown target and never scales. kubectl describe hpa already told you why: how to read AbleToScale, ScalingActive and ScalingLimited, and fix each one.

Read
DevOps & Containers11 min read

OOMKilled and Nothing Else: Finding What Really Ate Your Pod

Kubernetes records OOMKilled and exit code 137, then deletes the evidence. Here is how to read cgroup counters, kernel logs and working set to find the actual cause.

Read
Python & FastAPI7 min read

Uvicorn's 'uvicorn.error' Logger Is Not About Errors: Stop the False Alarms

Uvicorn tags routine INFO logs with the logger name uvicorn.error, tripping monitors that pattern-match on 'error'. Here is why, and how to alert on severity instead.

Read
DevOps & Containers7 min read

Your Logs, Metrics, and Traces Can't Talk: Fix Correlation Before the Next Incident

During an incident you should click from a metric spike to the exact traces and logs behind it, not squint at three clocks. The fix is one shared trace ID on every signal, built in before you need it.

Read
Linux & Servers7 min read

'The Server Is Slow' With Zero Budget and No APM: A Command-Line Triage

No Datadog, no New Relic, no dashboards. Here is a free, repeatable command-line order to find why a production server is slow, using tools already on the box.

Read
Python & FastAPI7 min read

Why Your FastAPI Logs Vanish Under Gunicorn and Uvicorn (and the Config That Works Everywhere)

FastAPI logs work in local dev but disappear in Docker under gunicorn+uvicorn, especially below WARNING. The cause is disable_existing_loggers and uvicorn's own loggers. Here is the fix.

Read
AI Engineering6 min read

Your LLM Cost Dashboard Says $0 and It's Lying: get_openai_callback

get_openai_callback returns 0 tokens and $0 after wrapping in AgentExecutor or upgrading LangChain, with no error. Here is why it silently detaches and how to count cost reliably.

Read
DevOps & Containers6 min read

OOMKilled Exit Code 137: Leak, Bad Limit, or JVM Off-Heap?

Exit code 137 looks the same whether it is a leak, a limit set too low, or JVM off-heap memory. Here is how to read the memory curve and tell the three apart.

Read
DevOps & Containers6 min read

Prometheus Cardinality Explosion: Find the Label Eating Your RAM

Prometheus is OOMing and queries time out with no config change to blame. One unbounded label is minting millions of series. Here is how to find and drop it.

Read
DevOps & Containers7 min read

Alert Fatigue Is a Discipline Problem, Not a Tooling Problem

Noisy on-call is not fixed by a better tool. It is fixed by deleting alerts that map to no action, tuning thresholds to real baselines, and correlating symptoms into one incident.

Read
Engineering Craft7 min read

What to Log So 3am-You Can Actually Debug It

Generic logging advice never shows the one line that ends an incident. A real failure walked through, the five fields that turn 'operation failed' into a diagnosis, and a PR checklist.

Read