Monitoring and dashboards
Quick answer
Monitoring repeatedly collects signals; dashboards visualize them and alerts request action when defined conditions occur.
A gap in a chart can mean missing telemetry rather than a zero value. Distinguish no data from a measured zero, use labeled units, and verify an alert with a controlled condition and recovery before relying on it.
Prepare the practice environment
Run python3 lab-fixtures/observability/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Run each snippet in a separate Bash process, not your interactive shell. Only private files are used; optional examples require an authorized snapshot VM. Do not change live monitoring or services. All supplied records are fictional. Review the lab guide.
Prerequisites
Review: SLIs, SLOs and error budgets.
How it works
Prometheus commonly scrapes metric endpoints, stores labeled time series and evaluates queries and rules. Node exporter exposes host resource metrics on supported systems; Grafana can visualize data from a configured source. Neither automatically instruments every application. A series is identified by its metric name and label set. Use bounded labels such as route templates and status class, not raw request IDs or emails. A counter rate should account for resets: PromQL rate() works on a range of counter samples; the simple fixture uses two samples without reset. Histograms support approximate quantile estimates from distributions; do not average percentiles across hosts. A dashboard should show user-facing latency, traffic, errors and saturation with units, time window and missing-data behavior. An alert should specify scope, duration and an actionable response; a brief CPU spike alone may not require paging. A missing scrape is not zero utilization. The included CSV is a hypothetical resource report, not measurements from a live exporter.
Try the examples
60 additional requests in 30 seconds; the model rejects resets.
Expected stdout:
2.00 requests/sThree consecutive one-minute samples cross the fictional threshold; this is not a production recommendation.
Expected stdout:
alert: cpu >= 80% for 3 consecutive samplesOptional availability check only; no server or scrape is started.
Manual example; not executed locally. Follow its stated environment restrictions.
Common mistakes
Never label every request with its unique ID in a metrics system; do not confuse counter values with rates.
Practice
Design a dashboard with request rate, error ratio, latency and resource saturation. Choose bounded labels and explain how you show missing samples.
Related references
Study: prometheus. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Monitoring and dashboards — Knowledge Check
Apply observability and reliability concepts to synthetic fixtures and VM-only scenarios.
Which label is bounded in a fixed API?
What does a counter rate require?
What does a failed scrape indicate?
What makes an alert useful?