teluzia.Cloud Engineer · Day 129
CHAPTER 19 · OBSERVABILITY AND RELIABILITY ENGINEERING

Grafana dashboards

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Data sources and queries is today's starting point. A data source can return an authentication error, no matching series, or a genuine zero. Run the same PromQL expression directly to distinguish these states before changing the dashboard. You will connect this with panels and units and variables and time ranges. The lesson's artifact brings these decisions together: Sketch four dashboard panels with exact query, unit, time window and expected healthy/failing appearance.

Think of it this way

A Grafana dashboard is a vehicle instrument panel: a displayed value is useful only when its sensor, unit and time scale are known.

TOPIC 01 / 03Step by step

Data sources and queries

Grafana queries a configured data source rather than manufacturing measurements. Verify the query directly before deciding a panel's empty state means zero traffic. A data source can return an authentication error, no matching series, or a genuine zero. Run the same PromQL expression directly to distinguish these states before changing the dashboard.

WORKED EXAMPLE
A data source can return an authentication error, no matching series, or a genuine zero. Run the same PromQL expression directly to distinguish these states before changing the dashboard.

A data source is the connection Grafana uses to query a backend; a query result is the returned series; a transformation changes the result for presentation. Consider a panel that worked yesterday but is empty after the service label changed. Test the backend connection, inspect the exact query and label selector, then compare the backend result with the transformed panel data. A successful connection test does not prove the expression matches a series. Transformations can accidentally join mismatched timestamps or hide missing values, so preserve the raw-result view during investigation. Credentials should be scoped to the required backend access and kept out of shared dashboard exports. Central data sources simplify reuse; a bad shared credential or configuration can affect many otherwise independent dashboards.

Why this matters

Run the same PromQL expression directly to distinguish these states before changing the dashboard.

A common trap

An empty panel proves the service received zero requests.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Data sources and queries

Grafana queries a configured data source rather than manufacturing measurements. Verify the query directly before deciding a panel's empty state means zero traffic. A data source can return an authentication error, no matching series, or a genuine zero. Run the same PromQL expression directly to distinguish these states before changing the dashboard.

WORKED EXAMPLE
A data source can return an authentication error, no matching series, or a genuine zero. Run the same PromQL expression directly to distinguish these states before changing the dashboard.

A data source is the connection Grafana uses to query a backend; a query result is the returned series; a transformation changes the result for presentation. Consider a panel that worked yesterday but is empty after the service label changed. Test the backend connection, inspect the exact query and label selector, then compare the backend result with the transformed panel data. A successful connection test does not prove the expression matches a series. Transformations can accidentally join mismatched timestamps or hide missing values, so preserve the raw-result view during investigation. Credentials should be scoped to the required backend access and kept out of shared dashboard exports. Central data sources simplify reuse; a bad shared credential or configuration can affect many otherwise independent dashboards.

Why this matters

Run the same PromQL expression directly to distinguish these states before changing the dashboard.

A common trap

An empty panel proves the service received zero requests.

Panels and units

A panel connects a question to a chart. Latency requires seconds or milliseconds, while request throughput needs a rate; an average can conceal tail latency. Use requests/second for throughput, seconds for latency and percentage for error ratio. A p95 latency of 0.8 seconds can coexist with a 0.1-second average because slow requests occupy the tail.

WORKED EXAMPLE
Use requests/second for throughput, seconds for latency and percentage for error ratio. A p95 latency of 0.8 seconds can coexist with a 0.1-second average because slow requests occupy the tail.

A histogram groups observations into buckets; a quantile estimates the value below which a selected proportion falls; a panel unit controls display interpretation. Imagine an API with many quick requests and a small group of multi-second requests. Display throughput, error ratio and a tail-latency query in separate panels rather than declaring a single average sufficient. Check that bucket boundaries and query aggregation support the chosen percentile. Label milliseconds as milliseconds; otherwise a plotted value of 500 can be read as seconds. Select a line chart for change over time and a stat for a current summarized value, but retain the measurement window. More panels can add context, yet an incident dashboard should prioritize the few questions that support immediate decisions.

Why this matters

A p95 latency of 0.8 seconds can coexist with a 0.1-second average because slow requests occupy the tail.

A common trap

Average latency reveals every slow request.

Variables and time ranges

Dashboard variables filter environments or services. A time range and aggregation interval affect interpretation; annotations connect deployments to changes without proving causality. Filter service="checkout" and a 30-minute window, then annotate the 14:05 release. Compare error-rate changes before and after; a coincident database outage remains a competing explanation.

WORKED EXAMPLE
Filter service="checkout" and a 30-minute window, then annotate the 14:05 release. Compare error-rate changes before and after; a coincident database outage remains a competing explanation.

A variable substitutes a selected value into a query; an annotation marks an event; a refresh interval controls when the dashboard reruns queries. Suppose environment changes from staging to production but one panel hardcodes staging. Audit every query's variable use before comparing their signals. Choose an absolute time window when reviewing an incident so the evidence does not move while being discussed. Annotate the configuration change and compare unaffected services to test whether it plausibly explains the change. A shorter refresh interval does not create new backend measurements between scrape intervals. Many simultaneous refreshes can increase backend load. Flexible variables improve reuse, while critical review dashboards benefit from explicit context that prevents an unnoticed environment or time-range mismatch. Export the selected context too.

Why this matters

Compare error-rate changes before and after; a coincident database outage remains a competing explanation.

A common trap

Deployment annotations prove the deployment caused every later anomaly.

KEEP THESE WITH YOU

Today’s takeaways

Data sources and queries: Grafana queries a configured data source rather than manufacturing measurements.

Panels and units: A panel connects a question to a chart.

Variables and time ranges: Dashboard variables filter environments or services.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed