Prometheus & Grafana — Complete Tutorial for Beginners to Advanced

2 minute read

Welcome to the Times of Cloud — Prometheus & Grafana Tutorial. This is a complete, hands-on guide that takes you from zero monitoring experience to confidently building production-grade observability stacks with Prometheus and Grafana.

Who Is This Tutorial For?

  • DevOps engineers who want to implement metrics-based monitoring and alerting
  • SREs (Site Reliability Engineers) who need to build full observability stacks
  • Developers who want to instrument applications with custom metrics
  • Platform engineers building monitoring infrastructure for Kubernetes clusters
  • Students preparing for CKA, CKAD, or cloud certifications where monitoring is tested
  • Anyone who wants to master modern metrics monitoring and visualization

What You Will Learn

By the end of this tutorial, you will be able to:

  1. Install and configure Prometheus, Grafana, and exporters
  2. Write PromQL queries for real-world monitoring scenarios
  3. Build custom Grafana dashboards with variables and annotations
  4. Instrument applications with Prometheus client libraries
  5. Set up alerting with Alertmanager (email, Slack, PagerDuty)
  6. Deploy kube-prometheus-stack on Kubernetes
  7. Configure service discovery for dynamic environments
  8. Implement long-term storage with Thanos or VictoriaMetrics
  9. Apply production best practices (HA, security, cardinality management)
  10. Build 5 real-world monitoring projects from scratch

Prerequisites

  • Basic Linux command-line knowledge
  • Docker and Docker Compose basics
  • A machine with at least 4 GB RAM (local or cloud VM)
  • No prior Prometheus or Grafana experience needed — we start from zero

Tutorial Structure

This tutorial is organized into 16 chapters across 6 areas:

Area 1 — Foundations (Chapters 1–3)

# Chapter What You’ll Learn
1 Introduction What Prometheus and Grafana are, pull vs push, ecosystem overview
2 Installation & Setup Install Prometheus, Grafana, Node Exporter, Docker Compose stack
3 Prometheus Fundamentals Time series, metric types, targets, scraping, prometheus.yml

Area 2 — PromQL (Chapters 4–5)

# Chapter What You’ll Learn
4 PromQL Basics Vectors, selectors, rate, increase, sum, avg, by/without
5 PromQL Advanced Binary operators, vector matching, recording rules, histogram_quantile

Area 3 — Exporters & Instrumentation (Chapters 6–7)

# Chapter What You’ll Learn
6 Exporters Node Exporter, Blackbox, cAdvisor, database exporters, custom exporters
7 Application Instrumentation Client libraries, counters, gauges, histograms, Python/Go/Node.js

Area 4 — Alerting & Grafana (Chapters 8–10)

# Chapter What You’ll Learn
8 Alerting Alerting rules, Alertmanager, routing, receivers, silences
9 Grafana Fundamentals Data sources, dashboards, panels, variables, annotations
10 Grafana Advanced Provisioning, alerting, dashboard as code, API, plugins

Area 5 — Kubernetes, Discovery & Storage (Chapters 11–13)

# Chapter What You’ll Learn
11 Kubernetes Monitoring kube-prometheus-stack, ServiceMonitor, PodMonitor, Operator
12 Service Discovery Static, file-based, Kubernetes SD, Consul, relabeling
13 Storage & Federation Local storage, remote write/read, Thanos, Cortex, federation

Area 6 — Production, Projects & Wrap-Up (Chapters 14–16)

# Chapter What You’ll Learn
14 Production Best Practices HA, performance, cardinality, security, backup
15 Practice Projects 5 real-world monitoring projects
16 Next Steps OpenTelemetry, Loki, Tempo, Mimir, community, FAQ

How to Use This Tutorial

  1. Follow in order — each chapter builds on the previous one
  2. Type every command — don’t just read, practice hands-on
  3. Complete the exercises — each chapter ends with practice exercises
  4. Build the projects — Chapter 15 ties everything together
  5. Bookmark and revisit — use this as a reference guide

Let’s begin with Chapter 1 — Introduction.

Updated: