Skip to main content
This guide shows how to build Grafana dashboards powered by Prometheus metrics to visualize the four golden signals: traffic, errors, latency, and saturation. We’ll create reusable time-series panels for an Order Processing application that combines frontend, backend, and Kubernetes infrastructure metrics. What you’ll do:
  • Generate realistic application traffic to produce observable metrics
  • Create a Grafana dashboard and save it as a reusable template
  • Build panels to measure Traffic, Errors, and Latency
  • Organize panels into rows grouped by the four golden signals
When deriving per-second rates from Prometheus counters, prefer rate() for standard windows and irate() for very short windows. Use a consistent rate interval such as [$__rate_interval] or a fixed window like [5m] across your dashboard to avoid confusing spikes.
Useful references:

Generate traffic in the application

Before building panels, configure the Order Processing UI simulator so you have live data:
  • Set async request rate to Low traffic
  • Set processing latency to Faster processing (if available)
  • Keep simulated error rate near 5%
Leave the simulator running while you build the dashboard so charts populate as you add panels.

Grafana access and dashboard creation

Log in to Grafana (lab default credentials):
Create a new dashboard:
  • Dashboards → New → Add new panel
  • Later, open Dashboard settings to name and describe the dashboard:
    • Name: Order Processing - Four Golden Signals
    • Description: Production monitoring dashboard for Order Processing application
Save the dashboard early and often to create a stable working baseline.

1) Traffic — Total application traffic (frontend + backend)

Goal: Answer “How much load is my system handling?” Panel: “Total application traffic” — combine frontend and backend request rates. PromQL (use Query A and Query B):
Panel settings:
  • Panel type: Time series
  • Tooltip → Mode: All
  • Tooltip → Values Sort Order: Descending
  • Legend → Mode: List
  • Legend → Values: Last (current value)
  • Query A → Options → Legend: Frontend (req/s)
  • Query B → Options → Legend: Backend (req/s)
  • Standard options → Unit: Throughput / requests/sec (reqps)
  • Graph styles → Fill opacity: 20
Save the panel. You should see two series (frontend and backend). Note: backend may be slightly higher if health checks or scraping traffic are present.

2) Traffic — Frontend traffic broken down by endpoint

Goal: Identify hotspots by frontend path. Panel: “Frontend traffic by endpoint” PromQL:
Panel settings:
  • Panel type: Time series
  • Tooltip → Mode: All
  • Tooltip → Values Sort Order: Descending
  • Legend → Mode: Table (or List)
  • Legend → Values: Last, Max
  • Standard options → Unit: Throughput / requests/sec (reqps)
  • Graph styles → Line width: 2
Tips:
  • Use a visible window of 5–30 minutes to find patterns.
  • Showing both last and max helps surface intermittent spikes.

3) Traffic — Backend traffic broken down by endpoint

Panel: “Backend traffic by endpoint” — similar to the frontend breakdown, grouping by the backend’s target label. PromQL:
Panel settings:
  • Panel type: Time series
  • Tooltip → Mode: All
  • Tooltip → Values Sort Order: Descending
  • Legend → Mode: Table
  • Legend → Values: Last, Max
  • Standard options → Unit: Throughput / requests/sec (reqps)
  • Graph styles → Line width: 2

4) Infrastructure — Pod network traffic (TX / RX)

Panel: “Pod network traffic” — monitor per-pod network transmit and receive rates converted to kilobytes/sec. PromQL:
Panel settings:
  • Panel type: Time series
  • Legend → Mode: Table
  • Legend → Values: Last, Max
  • Standard options → Unit: Data Rate / kilobytes/sec
  • Graph styles → Fill opacity: 10
  • Query A → Options → Legend: Tx - {{pod}}
  • Query B → Options → Legend: Rx - {{pod}}
Note: The pod=~"order-.*" regex filters application pods. Update namespace and regex to match your cluster.

5) Errors — Overall error rate (percentage)

Panel: “Error Rate (%)” — show percent of requests returning 5xx (or 4xx/5xx as required). PromQL (backend 5xx percentage):
Panel settings:
  • Panel type: Time series
  • Standard options → Unit: Percent (0–100)
  • Display → Decimals: 2 (optional)
  • Axes → Min: 0
  • Tooltip → Mode: All
  • Add thresholds for visual urgency (e.g., Green 0%, Yellow 1%, Red 5%)
Principle: Percent error rate is better for alerting than sheer error count; absolute counts are useful for assessing impact.
A split-screen browser lab interface: the left pane shows Task 8 instructions titled "Panel 6 - Error Count by Service" with Prometheus/Grafana query snippets, and the right pane displays a terminal with a KodeKloud ASCII banner. Browser tabs and lab controls (Grafana, Prometheus, Stop Lab) are visible across the top.

6) Errors — Error count by service (absolute errors per second)

Panel: “Errors per second by service” — absolute failed requests show user impact. PromQL examples (count 4xx/5xx per service):
Panel settings:
  • Panel type: Time series
  • Query A → Legend: Frontend errors (req/s)
  • Query B → Legend: Backend errors (req/s)
  • Standard options → Unit: Throughput / requests/sec
  • Axes → Min: 0
  • Add thresholds (example: Yellow 0.5 req/s, Red 2 req/s)
Tip: Compare percentage error and absolute error rate to understand how many users are affected.

7) Errors — HTTP status code distribution

Panel: “HTTP Status Code Distribution” — breakdown of response codes to identify error classes. PromQL examples:
Panel settings:
  • Panel type: Time series (or Table for discrete counts)
  • Tooltip → Mode: All
  • Legend → Mode: Table
  • Legend → Values: Last, Max
  • Standard options → Unit: Throughput / requests/sec
Use descriptive legends such as Frontend - {{status_code}} to make series self-explanatory.

8) Latency — Request latency percentiles (P50, P95, P99)

Panel: “Backend request latency percentiles” — capture typical and tail latencies using histogram quantiles. PromQL (using histogram buckets):
Panel settings:
  • Panel type: Time series
  • Query A Legend: p50 (median)
  • Query B Legend: p95
  • Query C Legend: p99
  • Tooltip → Mode: All
  • Tooltip → Values Sort Order: Descending
  • Standard options → Unit: Time / milliseconds (ms) — convert if your histogram is in seconds
  • Graph styles → Line width: 2
Histogram buckets are often exported in seconds (e.g., http_server_duration_seconds_bucket). Verify unit semantics in your metrics and set the panel unit (seconds → milliseconds) or multiply the query appropriately to display consistent units.
Important: Use the correct histogram metric and unit conversion. Incorrect units cause misleading SLO assessments.

9) Latency — Median response time by endpoint

Panel: “Backend Median Response Time by Endpoint” — drill into which endpoints are slower. PromQL:
Panel settings:
  • Panel type: Time series
  • Tooltip → Mode: All
  • Legend → Mode: Table
  • Legend → Values: Last, Max
  • Standard options → Unit: Time / milliseconds (ms)
  • Graph styles → Fill opacity: 15
Note: If labels differ in your instrumentation (for example, path vs http_target), update the group by label to match your metric set.
A screenshot of an "Order Processing Dashboard" web interface showing panels to configure async request rate, average processing latency, and simulated error rate. The options display "Low traffic", "Faster processing", and "~5% - Medium error rate" selected, with metric cards visible below.
Be aware: applications that both generate and consume simulated traffic can exhibit intermittent queues or backpressure. This may produce spikes or gaps depending on the simulator behavior.

Organize the dashboard into rows (Golden Signals)

Group related panels into collapsible rows for quick troubleshooting. Suggested structure:
  • Row: Golden Signal 1 — Traffic
    • Total application traffic
    • Frontend traffic by endpoint
    • Backend traffic by endpoint
    • Pod network traffic
  • Row: Golden Signal 2 — Errors
    • Error Rate (%)
    • Errors per second by service
    • HTTP status code distribution
  • Row: Golden Signal 3 — Latency
    • Backend request latency percentiles (P50, P95, P99)
    • Backend median response time by endpoint
Organizing by golden signal makes diagnosis faster by keeping related metrics together. Summary table (high-level overview): Save the dashboard after organizing rows and panels.
A monitoring dashboard titled "Order Processing - Four Golden Signals" displaying line charts for total application traffic, frontend/backend traffic by endpoint, and pod network throughput. The right sidebar shows row edit settings with Save and Exit edit buttons.
A dark-themed monitoring dashboard (Order Processing - Four Golden Signals) showing time-series charts. The panels display Error Rate (%) and HTTP Status Code Distribution with frontend/backend error lines and request rates.

Final recommendations

  • Keep label names and job names consistent across queries. Use templating (dashboard variables) to reuse this dashboard across environments or services.
  • Use [$__rate_interval] or a fixed 5m window consistently to avoid confusing artefacts.
  • Prefer percent error for alerts and absolute error counts for impact analysis.
  • Verify metric names and label keys in your application or exporter (e.g., status_code vs http_status_code, path vs http_target) and update queries accordingly.
  • Consider adding alert rules based on the percent error and tail latency percentiles (p95/p99) aligned with your SLOs.
This completes the lesson on building Grafana time-series panels to capture the four golden signals for the Order Processing application.

Watch Video