We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Observability Monitoring
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Observability Monitoring
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
A messaging team noticed their consumer was processing messages slower than usual. But they had no metrics on queue depth. By the time someone manually checked the queue, 2 million messages were backed up. It took 6 hours to drain.
If they'd had a gauge tracking queue depth, a number that goes up when messages arrive and down when they're consumed, they would have seen the buildup start within minutes. A simple alert: "queue depth > 10,000" would have caught it before it became a 6-hour recovery event.
Gauges measure the current state of something. Not how many events happened (that's a counter), but what's the value right now. How much memory is being used. How many connections are active. How deep is the queue. What's the CPU temperature. These are all values that fluctuate. They go up, they go down, and the current reading is what matters.
The distinction is simple but critical:
| Property | Counter | Gauge |
|---|---|---|
| Direction | Only increases | Goes up and down |
| On restart | Resets to zero | Re-reads current state |
| What it measures | Cumulative events | Current snapshot |
| Useful operation | rate(), how fast it changes | Direct value, what is it now |
| Example | Total requests served | Active connections right now |
Common gauges in production:
process_memory_bytes, current memory usagenode_cpu_utilization, current CPU percentagequeue_depth, messages waiting to be processedactive_connections, current open connectionsdisk_usage_percent, current disk utilizationthread_pool_active, threads currently busyWhen something breaks, gauges tell you the current state of the world. Is memory at 95%? Is the connection pool saturated? Is the disk full? These are all gauge readings, and they're usually the first thing you check during an incident.
It is easy and good
“It is really nice and good Please join the course”