Video in progress

What do the RED and USE methods give you when building a service dashboard?

RED (Rate, Errors, Duration) looks at the service from outside: the number of requests, the error share, the response time. USE (Utilization, Saturation, Errors) looks at resources: how busy the CPU, memory and pools are and whether there is a queue. The first is "what the user is noticing", the second is "why".

📖 Answer

Facing an empty Grafana with "what do I draw?", these two methods give a ready answer.

RED, for every endpoint or service:

  • Rate: sum(rate(http_server_requests_seconds_count[5m]))
  • Errors: the 5xx share
  • Duration: p50/p95/p99 from the histogram

USE, for every resource:

  • CPU: utilization is a percentage, saturation is the load average or throttling (in a container);
  • HikariCP: hikaricp_connections_active / max is the busy share, hikaricp_connections_pending is the waiters, meaning saturation;
  • the Tomcat thread pool: busy and max threads;
  • JVM heap and GC pauses;
  • Kafka consumer lag: a queue is saturation too.

In practice a dashboard is read from top to bottom: RED at the top (is there a problem?), USE at the bottom (which resource is the bottleneck?). For example, p99 went up and at the same time hikaricp_connections_pending jumped from 0 to 40: the pool is exhausted, and a slow query or transaction is holding on to a connection.

Saturation is the part most often forgotten. CPU can sit at 60%, but if 50 threads are queued on the connection pool, the user feels it as slowness.