TechCoder.io / System Design

Health Checks & Observability

Master the three pillars of observability (Metrics, Logs, Traces), Kubernetes liveness and readiness probes, distributed tracing with OpenTelemetry, alerting strategies, and how to build dashboards that catch issues before users do.

By TechCoder TeamLast updated: 2026-10-17
In a Nutshell

Master the three pillars of observability (Metrics, Logs, Traces), Kubernetes liveness and readiness probes, distributed tracing with OpenTelemetry, alerting strategies, and how to build dashboards that catch issues before users do. This hands-on tutorial focuses on practical implementation of health checks & observability concepts.

Health Checks & Observability

Observability is the ability to understand the internal state of a system from its external outputs. You can't fix what you can't see. In distributed systems with dozens of microservices, a request might touch 10 services before returning an error — without proper observability, you have no idea which service caused it.

[!IMPORTANT] Monitoring = knowing that something is broken. Observability = understanding why it's broken. You need both. Monitoring tells you "error rate is 5%." Observability helps you trace which service, which query, which user is causing it.

Health Check Endpoints

Every production service must expose health endpoints for load balancers and orchestrators (Kubernetes) to query:

PYTHON PLAYGROUND
⏳ Loading editor…

The Three Pillars of Observability

PYTHON PLAYGROUND
⏳ Loading editor…

The Four Golden Signals (Google SRE)

Google's SRE book defines four signals that are sufficient to monitor any service:

SignalMetricAlert Threshold Example
Latencyp99 response timeAlert if p99 > 500ms for 5 min
TrafficRequests per secondAlert if drops >50% (possible outage)
ErrorsError rate (4xx/5xx %)Alert if >1% error rate
SaturationCPU/Memory/DB connectionsAlert if DB connections >80% of pool

Quiz

Quiz

Question 1 of 2

Your service's database goes down. Your liveness probe (/health/live) returns 503. Your readiness probe (/health/ready) also returns 503. What does Kubernetes do?

Kubernetes removes the pod from the load balancer and restarts it (because liveness failed)
Kubernetes only removes the pod from load balancer rotation (readiness failed), does NOT restart it
Kubernetes does nothing — it waits for the database to come back

Key Takeaways

✅ Liveness probe failure = restart the container. Readiness probe failure = remove from load balancer only.
✅ The three pillars: Metrics (what's happening), Logs (what happened), Traces (why it happened).
✅ Structured JSON logs are machine-queryable — always include trace_id, user_id, duration_ms.
✅ Distributed tracing propagates a trace_id across services, enabling end-to-end request visibility.
✅ Monitor the four golden signals: Latency, Traffic, Errors, Saturation.

Official Resources

What's Next?

Your infrastructure is resilient and observable. Now let's tackle async communication between services.
Next: Message Queues — Kafka, RabbitMQ & SQS — How async messaging decouples services and enables event-driven architectures.