> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Building Golden Signal Time Series Panels

> Guide to building Grafana dashboards with Prometheus metrics to visualize traffic, errors, latency, and saturation for an Order Processing application.

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:

* [Prometheus Overview](https://prometheus.io/docs/introduction/overview/)
* [Grafana Panel Types and Options](https://grafana.com/docs/grafana/latest/panels/)

## 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):

```bash theme={null}
# Grafana credential example
Username: admin
Password: admin
```

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):

```promql theme={null}
# Query A - Frontend request rate (requests / second)
sum(rate(http_request_duration_seconds_count{job="order-frontend"}[$__rate_interval]))

# Query B - Backend request rate (requests / second)
sum(rate(http_server_duration_seconds_count{job="order-backend"}[$__rate_interval]))
```

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:

```promql theme={null}
sum by (path) (rate(http_request_duration_seconds_count{job="order-frontend"}[$__rate_interval]))
```

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:

```promql theme={null}
sum by (http_target) (rate(http_server_duration_seconds_count{job="order-backend"}[$__rate_interval]))
```

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:

```promql theme={null}
# Query A - TX (kilobytes/sec)
1e-3 * sum by (pod) (rate(container_network_transmit_bytes_total{namespace="default", pod=~"order-.*", job="kubelet"}[$__rate_interval]))

# Query B - RX (kilobytes/sec)
1e-3 * sum by (pod) (rate(container_network_receive_bytes_total{namespace="default", pod=~"order-.*", job="kubelet"}[$__rate_interval]))
```

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):

```promql theme={null}
# Backend 5xx error percentage
100 * (
  sum(rate(http_server_duration_seconds_count{job="order-backend", http_status_code=~"5.."}[$__rate_interval]))
  /
  sum(rate(http_server_duration_seconds_count{job="order-backend"}[$__rate_interval]))
)
```

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.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Visualizing-Metrics-in-Grafana/Demo-Building-Golden-Signal-Time-Series-Panels/split-screen-kodekloud-grafana-prometheus-terminal.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=abba383fd66f26590286c1401248c7aa)

***

## 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):

```promql theme={null}
# Query A - Frontend errors per second (4xx and 5xx)
sum by (service) (rate(http_request_duration_seconds_count{job="order-frontend", status_code=~"4..|5.."}[5m]))

# Query B - Backend errors per second (4xx and 5xx)
sum by (service) (rate(http_server_duration_seconds_count{job="order-backend", http_status_code=~"4..|5.."}[5m]))
```

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:

```promql theme={null}
# Query A - Frontend status codes (breakdown by status_code)
sum by (status_code) (rate(http_request_duration_seconds_count{job="order-frontend"}[$__rate_interval]))

# Query B - Backend status codes
sum by (http_status_code) (rate(http_server_duration_seconds_count{job="order-backend"}[$__rate_interval]))
```

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):

```promql theme={null}
# P50 (median)
histogram_quantile(0.50, sum by (le) (rate(http_server_duration_seconds_bucket{job="order-backend"}[5m])))

# P95
histogram_quantile(0.95, sum by (le) (rate(http_server_duration_seconds_bucket{job="order-backend"}[5m])))

# P99
histogram_quantile(0.99, sum by (le) (rate(http_server_duration_seconds_bucket{job="order-backend"}[5m])))
```

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:

```promql theme={null}
histogram_quantile(
  0.50,
  sum by (le, http_target) (rate(http_server_duration_seconds_bucket{job="order-backend"}[$__rate_interval]))
)
```

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.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Visualizing-Metrics-in-Grafana/Demo-Building-Golden-Signal-Time-Series-Panels/order-processing-dashboard-traffic-latency-errors.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=6bded61035cb21eb2b4c35b1df18080b)

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):

| Golden Signal | Example Panels | Key Metric |
| - | - | -: |
| Traffic | Total traffic, Frontend/Backend by endpoint | Requests/sec |
| Errors | Error Rate (%), Errors/sec | Percent errors + absolute errors |
| Latency | P50/P95/P99, median by endpoint | Response time (ms) |
| Saturation / Infra | Pod network traffic | Bytes/sec or KB/sec |

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.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Visualizing-Metrics-in-Grafana/Demo-Building-Golden-Signal-Time-Series-Panels/order-processing-golden-signals-dashboard.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=008fe57bc5ee755addd46e7f96b491f1)

![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.](https://mintcdn.com/kodekloud-c4ac6d9a/qM9vA-hQoWNCxcKa/images/Grafana-Prometheus-for-Metrics-Driven-Observability/Visualizing-Metrics-in-Grafana/Demo-Building-Golden-Signal-Time-Series-Panels/order-processing-error-rate-http-status.jpg?fit=max\&auto=format\&n=qM9vA-hQoWNCxcKa\&q=85\&s=1cab37b500780551e998f7a136e8386c)

***

## 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.

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/grafana-prometheus-for-metrics-driven-observability/module/38f09b30-873f-4fee-aef2-95161646dfdc/lesson/87eb2180-d701-47be-ada1-bd815666aeca)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.