Skip to content
Tutorials Center
My learning

Topics

Monitoring (Prometheus, Grafana) Tutorial

Learn Monitoring (Prometheus, Grafana) step by step: 27 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Monitoring Fundamentals

  1. 1 What Monitoring Is and Why It Matters Learn what monitoring and observability are, how metrics, logs and traces differ, why alert on symptoms, and where Prometheus and Grafana fit in.
  2. 2 RED, USE and the Golden Signals Choose what to measure: the RED method, the USE method, the four golden signals, plus SLIs, SLOs and error budgets, with runnable examples.

Prometheus Basics

  1. 3 How Prometheus Works Understand the Prometheus architecture: the pull model, scrape targets, exporters, the time series database, retention, service discovery and Alertmanager.
  2. 4 Installing Prometheus and Your First Scrape Install Prometheus from a binary or Docker, write prometheus.yml with scrape_configs, open the web UI and Targets page, and read the up metric.
  3. 5 Metrics, Labels and Time Series Learn the Prometheus data model: metric names, labels, samples, time series, cardinality, naming conventions and the text exposition format.
  4. 6 Counters, Gauges, Histograms and Summaries Learn the four Prometheus metric types, when to use each, how counter resets and histogram buckets work, and how quantiles are estimated.

Instrumenting Applications

  1. 7 Instrumenting Your Code Add Prometheus metrics to your own code with client libraries for Python, Go, Java and Node.js, expose /metrics, and avoid label and naming mistakes.
  2. 8 Exporters: Node, Blackbox and Friends Monitor servers, containers, websites and databases you cannot modify with Prometheus exporters, use the textfile collector, and know when Pushgateway is wrong.
  3. 9 Service Discovery and Relabeling Let Prometheus find its targets automatically with file_sd, DNS, Kubernetes and cloud discovery, then rewrite labels with relabel_configs and metric_relabel_configs.

PromQL

  1. 10 PromQL Basics Learn PromQL from the ground up: instant and range vectors, label matchers, offset, subqueries, and how staleness and the lookback window decide results.
  2. 11 rate, increase and Counter Math Understand how rate, irate and increase work on counters: resets, window size, extrapolation and the common mistakes that give wrong graphs and alerts.
  3. 12 Aggregation, Joins and Vector Matching Combine time series in PromQL: sum, avg, topk and count with by and without, binary operators, on and ignoring, group_left joins, and absent().
  4. 13 Quantiles, Histograms and SLI Queries Turn histogram buckets into latency percentiles with histogram_quantile, write error-rate and availability queries, and learn how accurate the estimates really are.

Recording Rules and Alerting

  1. 14 Recording Rules and Query Performance Precompute expensive PromQL with recording rules: rule groups, the level:metric:operations naming scheme, when to use them and how to spot slow queries.
  2. 15 Alerting Rules and Alertmanager Write Prometheus alert rules with for durations, labels and annotations, then route, group, inhibit and silence them with Alertmanager receivers.

Grafana

  1. 16 Grafana: Data Sources and Dashboards Install Grafana, connect it to Prometheus, build panels with PromQL queries, add variables and time ranges, and provision everything from files.
  2. 17 Designing Dashboards That Help Design Grafana dashboards people can act on: layout, RED and USE patterns, units and thresholds, templating, annotations, dashboards as code and common mistakes.

Production Practice

  1. 18 Scaling, Retention and Long-Term Storage Size a Prometheus server, set retention, use federation and remote write, run HA pairs and compare Thanos, Mimir and VictoriaMetrics for long-term storage.
  2. 19 Monitoring Kubernetes and Containers Monitor a Kubernetes cluster with Prometheus: kube-state-metrics, cAdvisor, pod discovery, ServiceMonitor and the Prometheus Operator, plus resource queries.
  3. 20 Security, Cardinality and Common Pitfalls Secure Prometheus endpoints with TLS and auth, keep /metrics private, avoid label explosions and alert fatigue, and test rules with promtool before production.

Projects

  1. 21 Project: Instrument a Web Service and Build Its Dashboard Add request rate, error and duration metrics to a web service, scrape it with Prometheus, write the PromQL and Grafana panels, and track an availability SLO.
  2. 22 Project: Alerts with Burn Rates and Routing Build SLO alerts that page only when the error budget burns fast: multi-window burn-rate rules, severity routing in Alertmanager and runbook annotations.
  3. 23 Project: Monitor a Fleet of Servers Monitor a fleet of Linux servers: install node_exporter, discover hosts with file_sd, write host queries, predict full disks with predict_linear and build a dashboard.
  4. 24 Project: A Complete Monitoring Stack with Docker Compose Run Prometheus, Grafana, Alertmanager, node_exporter and cAdvisor with Docker Compose, provision the data source and dashboards as files, and validate it all.

Practice and Review

  1. 25 Exercises with Solutions Twelve graded Prometheus exercises on PromQL, instrumentation, alert rules and relabeling, each with a worked answer and runnable stand-ins for the math.
  2. 26 Interview Questions Prepare for monitoring interviews with short model answers on Prometheus concepts, PromQL, alerting, architecture, scaling and Grafana, plus runnable stand-ins.
  3. 27 Prometheus and Grafana Cheat Sheet One-page Prometheus and Grafana cheat sheet: config snippets, metric types, label matchers, common PromQL, recording and alert rules, burn rates and promtool commands.