Learn Grafana

Dashboards, exploration and alerting on top of your metrics, logs and traces

32 lessons · 6 hours · 4 levels · covers Grafana 13

Grafana is an open-source observability front end: it queries data sources such as Prometheus, Loki, PostgreSQL or cloud monitoring services and shows the results as interactive dashboards. Teams use it to watch systems in real time, investigate incidents with logs and traces side by side, and alert on what they see. It is the most common way to visualize Prometheus metrics.

Before you start

Grafana builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics9 lessons · 1 hour in total
2. PracticalUse it productively at work, with the usual idioms20 lessons · 3 hours in total
3. AdvancedThe less common features, performance and trade-offs28 lessons · 5 hours in total
4. ExpertInternals and the edge cases experts know32 lessons · 6 hours in total

The Grafana tree

GrafanaWhat Grafana isWhat Grafana isInstalling Grafana and adding PrometheusInstalling Grafana andadding PrometheusYour first dashboard and panelsYour first dashboardand panelsTime range, zoom and auto-refreshTime range, zoomand auto-refreshExplore: ad-hoc queries and split viewExplore: ad-hocqueries and split vi…Time series panel, legend and tooltipsTime series panel,legend and tooltipsUnits, thresholds, value mappings and overridesUnits, thresholds,value mappings an…Stat, gauge and bar gaugeStat, gauge and bargaugeTable panelTable panelHeatmap, state timeline and logs panelsHeatmap, statetimeline and logs p…Dashboard variables and templatingDashboard variablesand templatingTransformationsTransformationsRows, repeating panels and library panelsRows, repeatingpanels and library…Annotations, dashboard links and data linksAnnotations,dashboard links an…SQL data sources and macrosSQL data sourcesand macrosLoki and LogQL basicsLoki and LogQLbasicsTempo traces and TraceQLTempo traces andTraceQLGrafana Alerting overviewGrafana AlertingoverviewAlert rule anatomy: queries and expressionsAlert rule anatomy:queries and expres…Contact points and notification policiesContact points andnotification policiesRunning Prometheus and scraping targetsRunning Prometheusand scraping targetsPromQL basics: selectors and vectorsPromQL basics:selectors and vectorsLatency percentiles with histogram_quantileLatency percentileswith histogram_qua…The data model: metrics, labels and seriesThe data model:metrics, labels and…Alerting rulesAlerting rulesrate, irate and increase for countersrate, irate andincrease for counters
Essentials and Practical shown (20 of 32 lessons); the full list is below. Click a lesson to read it.

All 32 lessons, in order

Getting started

  1. What Grafana is · Essentials · 5 min

    Grafana queries many data sources and visualizes them in dashboards; it stores almost no monitoring data itself.

  2. Installing Grafana and adding Prometheus · Essentials · 10 min

    Run Grafana in Docker, log in, and connect a Prometheus data source with the right URL and scrape interval.

  3. Your first dashboard and panels · Essentials · 12 min

    Create a dashboard, add time series and stat panels with PromQL queries, set legends and the time range, and save it.

  4. Time range, zoom and auto-refresh · Essentials · 7 min

    Use the time picker's relative and absolute ranges, zoom into graphs, share links with the range, and set auto-refresh sensibly.

  5. Explore: ad-hoc queries and split view · Essentials · 8 min

    Use Explore to try PromQL without a dashboard: the metrics browser, Builder and Code modes, split view, query history and "Add to dashboard".

Panels and visualizations

  1. Time series panel, legend and tooltips · Essentials · 10 min

    Configure the time series visualization: lines, bars, points, fill and stacking, axes, null handling, legend modes with calculations, and tooltip modes.

  2. Stat, gauge and bar gauge · Essentials · 8 min

    Show single values well: the reduce calculation, colour and graph modes of Stat, min/max and markers for Gauge, and Bar gauge for comparing many values.

  3. Table panel · Essentials · 8 min

    Build readable tables: instant queries in table format, column filters, cell display modes (coloured background, gauge, sparkline) and footers.

  4. Heatmap, state timeline and logs panels · Practical · 10 min

    Draw latency distributions from Prometheus histograms as heatmaps, show discrete states over time with state timeline and status history, and embed logs.

Building dashboards

  1. Units, thresholds, value mappings and overrides · Essentials · 10 min

    Make panels readable with units, decimals, min and max, colour thresholds, value mappings and per-series overrides.

  2. Dashboard variables and templating · Practical · 12 min

    Add drop-down variables from label values, use them in queries with multi-value and All options, and repeat panels per value.

  3. Transformations · Practical · 10 min

    Reshape query results inside Grafana: join and merge queries, reduce series to rows, rename, filter and calculate fields.

  4. Rows, repeating panels and library panels · Practical · 9 min

    Arrange panels on the 24-column grid, group them in collapsible rows, repeat panels or rows per variable value, and reuse library panels.

  5. Annotations, dashboard links and data links · Practical · 10 min

    Mark events with manual and query-driven annotations, link dashboards with variables and time range preserved, and make values clickable with data links.

  6. Dashboard JSON model, export and versions · Advanced · 10 min

    Read the dashboard JSON model (uid, panels, templating, schemaVersion), export and import portable JSON, and compare and restore versions.

  7. Dashboard design: RED, USE, golden signals · Advanced · 10 min

    Structure dashboards around RED, USE and the four golden signals, build a drill-down hierarchy, and apply layout conventions that work in incidents.

Logs, traces and other data sources

  1. SQL data sources and macros · Practical · 10 min

    Chart data from PostgreSQL or MySQL with time-series queries, Grafana's time macros and table formats.

  2. Loki and LogQL basics · Practical · 12 min

    Query logs in Loki: stream selectors, line filters, json and logfmt parsers, label filters, line_format, and metric queries that turn logs into graphs.

  3. Tempo traces and TraceQL · Practical · 10 min

    Find and read distributed traces in Tempo: spans and attributes, TraceQL filters and aggregates, the trace waterfall view, and the service graph.

  4. Grafana Alerting overview · Practical · 14 min

    Create alert rules with queries, expressions and pending periods, and route notifications through contact points and notification policies.

  5. Correlating metrics, logs and traces · Advanced · 12 min

    Jump from a latency spike to the trace behind it and from a span to its logs with exemplars, derived fields, trace-to-logs links and split view.

Alerting

  1. Alert rule anatomy: queries and expressions · Practical · 12 min

    Build a Grafana-managed rule step by step: queries, Reduce, Math and Threshold expressions, the condition, labels, templated annotations, pending period.

  2. Contact points and notification policies · Practical · 12 min

    Route alerts: contact point integrations and templates, the notification policy tree with matchers and grouping, timings, mute timings and silences.

  3. Alert states, evaluation groups and history · Advanced · 10 min

    How evaluation groups schedule rules, the Normal, Pending, Alerting, Recovering, NoData and Error states, no-data handling and state history.

Running Grafana

  1. Provisioning and dashboards as code · Advanced · 14 min

    Define data sources and dashboards in files, understand the dashboard JSON model, and manage Grafana from Git with provisioning, Terraform or Git Sync.

  2. Grafana as code: grafana.ini and Terraform · Advanced · 12 min

    Configure the server with grafana.ini and GF_ variables, and manage folders, dashboards, data sources and alerting with the Terraform provider.

  3. Grafana on Kubernetes with Helm · Advanced · 12 min

    Deploy Grafana with the official Helm chart: admin secret, persistence, provisioned data sources, dashboards from ConfigMaps, kube-prometheus-stack.

  4. Users, teams, folders and service accounts · Advanced · 10 min

    Control who sees and edits what with organizations, roles, teams, folder permissions and service accounts for automation.

Performance and internals

  1. Max data points, intervals and $__rate_interval · Expert · 14 min

    How Grafana computes the query step and $__interval from the time range and panel width, and why $__rate_interval exists.

  2. Query performance and caching · Expert · 12 min

    Find slow panels with the query inspector, then cut load with min interval, max data points, incremental querying, recording rules and caching.

  3. Plugins and the data source proxy · Expert · 14 min

    How panel, data source and app plugins work, the frontend/backend split, server-side query execution and plugin security.

  4. High availability and scaling Grafana · Expert · 12 min

    Run several Grafana instances on a shared database, make alerting highly available, and keep big installations fast.