Video in progress
What are the RED and USE methods? Which metrics do you put on a service dashboard first?
RED is for services that handle requests: Rate (request rate), Errors, Duration (latency distribution). USE is for resources: Utilization, Saturation, Errors. A service dashboard starts with RED, and when you hunt for the cause you drop down to USE: pools, CPU, queues.
📖 Answer
Nobody reads a dashboard with hundreds of graphs during an incident. RED answers three questions: how many requests are coming in, how many are failing, how long they take.
In Spring Boot all of this comes from the http.server.requests metric (you add the application tag yourself with management.metrics.tags.application):
# Rate
sum(rate(http_server_requests_seconds_count{application="order-service"}[1m]))
# Errors (share of 5xx)
sum(rate(http_server_requests_seconds_count{application="order-service",status=~"5.."}[1m]))
/ sum(rate(http_server_requests_seconds_count{application="order-service"}[1m]))
# Duration (p99)
histogram_quantile(0.99, sum by (le) (
rate(http_server_requests_seconds_bucket{application="order-service"}[5m])))
Histogram buckets are not enabled by default: you need management.metrics.distribution.percentiles-histogram.http.server.requests=true. Don't trust the average, because it hides the slowest 1% of requests.
RED shows "what is happening", USE shows "why". USE resources for a Java service:
- Tomcat threads: busy/max (utilization), queued requests (saturation);
- HikariCP:
hikaricp_connections_activeandhikaricp_connections_pending. If pending is constantly above zero, the DB pool is saturated; - HTTP client pools, Kafka consumer lag;
- CPU and CPU throttling, heap and GC pause time.
I lay the dashboard out like this: RED for incoming traffic at the top, client RED for each downstream below it (http.client.requests), and USE at the bottom. When latency goes up, your eyes move from top to bottom: is the problem in our own service, in a downstream, or in a resource?
Sign up to mark studied questions and save your progress.