GRAFANA
MASTERY

// See everything. Know everything.

DATA WITHOUT VISUALIZATION IS JUST NOISE.

Grafana transforms your metrics into beautiful, actionable dashboards. Watch your systems in real-time, spot anomalies, and make data-driven decisions.

ONE DASHBOARD TO RULE THEM ALL.

From server metrics to application performance, from IoT sensors to financial data—Grafana connects to virtually any data source and makes sense of it all.

BEGIN YOUR JOURNEY

// Your Training Path

Click a lesson to begin

LESSON 01

Introduction to Grafana

What is Grafana? Installation and first login.

Beginner
LESSON 02

Data Sources

Connect to Prometheus, InfluxDB, MySQL, and more.

Beginner
LESSON 03

Your First Dashboard

Create panels, add queries, and organize dashboards.

Beginner
LESSON 04

Visualization Types

Graph, stat, gauge, table, heatmap, and more.

Beginner
LESSON 05

Queries & Variables

Template variables, filters, and dynamic dashboards.

Intermediate
LESSON 06

Alerts & Notifications

Set up alerts and send notifications via email, Slack, PagerDuty.

Intermediate
LESSON 07

Prometheus & Grafana

Query PromQL, explore metrics, and build custom dashboards.

Intermediate
LESSON 08

Annotations

Mark events on graphs. Correlate metrics with incidents.

Intermediate
LESSON 09

Plugins & Transformations

Extend Grafana. Transform data for complex visualizations.

Advanced
LESSON 10

User Management

Teams, permissions, organization, and authentication.

Advanced
LESSON 11

Provisioning

Configure Grafana as code. Dashboards, datasources, and alerts.

Advanced
LESSON 12

Best Practices

Performance, security, and dashboard design patterns.

Advanced

// Lesson 01: Introduction to Grafana

×

What is Grafana?

Grafana is an open-source platform for monitoring and observability. It connects to multiple data sources and creates interactive, beautiful dashboards.

Key Features

  • Visualizations: Graphs, tables, heatmaps, and more
  • Alerts: Notify when metrics cross thresholds
  • Templating: Dynamic, reusable dashboards
  • Plugins: Extend with additional data sources

Installing Grafana

# Debian/Ubuntu
sudo apt-get install -y apt-transport-https software-properties-common
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt-get update && sudo apt-get install grafana

# Start service
sudo systemctl start grafana-server
sudo systemctl enable grafana-server

First Login

Navigate to http://localhost:3000 and login with admin/admin.

Quiz

1. What is Grafana used for?

Show Answers
  1. Monitoring and visualization / dashboards

// Lesson 02: Data Sources

×

Supported Data Sources

  • Prometheus: Metrics and alerts
  • InfluxDB: Time series data
  • MySQL/PostgreSQL: SQL databases
  • Graphite: Metrics
  • Elasticsearch: Logs and metrics

Adding a Data Source

  1. Click Configuration (gear icon) → Data Sources
  2. Click "Add data source"
  3. Select your data source type
  4. Configure connection details
  5. Click "Save & Test"

Prometheus Example

# In Grafana:
URL: http://localhost:9090
Access: Server (default)
Auth: None (for local)

# Click Save & Test

Quiz

1. Where do you add data sources in Grafana?

Show Answers
  1. Configuration → Data Sources

// Lesson 03: Your First Dashboard

×

Creating a Dashboard

  1. Click "+" icon → Dashboard
  2. Click "Add new panel"
  3. Select your data source
  4. Write a query
  5. Configure panel options
  6. Click "Save" (Ctrl+S)

A Simple Query

# For Prometheus:
up

# This returns 1 if target is up, 0 if down

Panel Editor

  • Queries tab: Write data queries
  • Visualization: Choose graph type
  • Panel options: Title, description
  • Field: Units, decimals
  • Alert: Create alerts

Quiz

1. What query returns the uptime status in Prometheus?

Show Answers
  1. up

// Lesson 04: Visualization Types

×

Graph Panel

Time series visualization. Best for metrics over time.

  • Lines, bars, or points
  • Multiple series
  • Time range selection

Stat Panel

Single big number with optional sparkline.

Gauge Panel

Display current value on a gauge. Good for thresholds.

Table Panel

Tabular data. Transform query results.

Heatmap

Visualize density. Great for frequency data.

Logs Panel

Display log entries. Filter and search.

Quiz

1. Which panel is best for single values?

Show Answers
  1. Stat panel

// Lesson 05: Queries & Variables

×

Template Variables

Variables make dashboards dynamic and reusable.

Creating Variables

  1. Dashboard settings (gear icon)
  2. Variables → Add variable
  3. Configure name, query, and options

Example Variable

# Query:
label_values(up, job)

# This creates a dropdown of all job labels

Using Variables in Queries

# Use $variable in queries:
up{job="$job"}

# Or multi-select:
up{job=~"$job"}

Quiz

1. What makes dashboards dynamic?

Show Answers
  1. Variables / template variables

// Lesson 06: Alerts & Notifications

×

Creating Alerts

  1. Edit a panel
  2. Go to "Alert" section
  3. Click "Create Alert"
  4. Configure conditions
  5. Set evaluation interval

Alert Conditions

  • OF: Query results
  • IS BELOW/Above: Threshold
  • FOR: Duration to trigger

Notification Channels

  • Email: Simple notifications
  • Slack: Team notifications
  • PagerDuty: Incident management
  • Webhook: Custom integrations
  • Telegram: Bot notifications

Configuring Slack

  1. Configuration → Notification channels
  2. Add Slack
  3. Provide Slack webhook URL
  4. Select default channels

Quiz

1. Where do you configure notification channels?

Show Answers
  1. Configuration → Notification channels

// Lesson 07: Prometheus & Grafana

×

PromQL Basics

# All metrics
up

# With label filter
up{job="node"}

# Rate (per second)
rate(http_requests_total[5m])

# Sum by label
sum by (job) (up)

# Histogram quantile
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))

Useful Prometheus Queries

  • CPU usage: 100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
  • Memory usage: (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100
  • Disk usage: (node_filesystem_size_bytes{mountpoint="/"} - node_filesystem_avail_bytes{mountpoint="/"}) / node_filesystem_size_bytes{mountpoint="/"} * 100

Grafana Explore

Use Explore (compass icon) to query data without creating dashboards.

Quiz

1. What language does Prometheus use?

Show Answers
  1. PromQL

// Lesson 08: Annotations

×

What are Annotations?

Annotations mark events on your graphs. They're perfect for showing deployments, incidents, or changes.

Adding Annotations

  1. Click on a graph
  2. Click "Add annotation"
  3. Enter title and text
  4. Optionally set tags

Custom Data Source Annotations

Query annotations from your data source:

# Example query for annotations
SELECT time, title, text FROM events WHERE $__timeFilter(time)

Use Cases

  • Deployments
  • Incidents
  • Config changes
  • Maintenance windows

Quiz

1. What are annotations used for?

Show Answers
  1. Marking events on graphs

// Lesson 09: Plugins & Transformations

×

Installing Plugins

# Install via CLI
grafana-cli plugins install 

# Or via UI
# Configuration → Plugins → Install

Popular Plugins

  • Worldmap Panel: Geographic visualization
  • Clock Panel: Time display
  • Polystat: Status at a glance
  • Apache ECharts: Advanced charting

Transformations

Transform data before visualization:

  • Reduce: Aggregate rows
  • Filter by name: Include/exclude fields
  • Organize fields: Rename, hide, reorder
  • Outer join: Merge series
  • Calculate fields: Math operations

Quiz

1. How do you install plugins?

Show Answers
  1. grafana-cli or UI

// Lesson 10: User Management

×

Users & Permissions

  • Admin: Full access
  • Editor: Can edit dashboards
  • Viewer: View only

Organizations

Separate teams or environments:

  • Each org has own data sources
  • Users belong to orgs
  • Switch org in user menu

Teams

  1. Configuration → Teams
  2. Create team
  3. Add members
  4. Set team permissions

SSO Integration

  • OAuth (GitHub, Google, etc.)
  • LDAP/Active Directory
  • SAML

Quiz

1. What permission can edit dashboards?

Show Answers
  1. Editor

// Lesson 11: Provisioning

×

What is Provisioning?

Configure Grafana as code. No manual setup needed.

Provisioned Files

  • datasources/ Data source configs
  • dashboards/ Dashboard definitions
  • notifiers/ Notification channels

Example Datasource Config

# /etc/grafana/provisioning/datasources/prometheus.yml
apiVersion: 1

datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://localhost:9090
    isDefault: true

Dashboard Provisioning

# /etc/grafana/provisioning/dashboards/default.yml
apiVersion: 1

providers:
  - name: 'Default'
    folder: 'Dashboards'
    type: file
    options:
      path: /var/lib/grafana/dashboards

Quiz

1. What folder contains datasource configs?

Show Answers
  1. datasources/

// Lesson 12: Best Practices

×

Dashboard Design

  • Start with high-level overview
  • Drill down with detail dashboards
  • Use consistent naming
  • Add descriptions to panels

Performance Tips

  • Reduce query frequency
  • Use recording rules for complex queries
  • Limit time range by default
  • Disable unused panels

Security

  • Use HTTPS in production
  • Enable authentication
  • Restrict data source access
  • Rotate API keys

Alert Best Practices

  • Alert on symptoms, not causes
  • Set reasonable thresholds
  • Avoid alert storms
  • Include runbook links

Congratulations!

You've completed the Grafana Mastery guide. You now understand:

  • Grafana fundamentals
  • Data source configuration
  • Dashboard creation
  • Visualization types
  • Variables and templating
  • Alerts and notifications
  • Prometheus queries
  • Annotations
  • Plugins and transformations
  • User management
  • Provisioning
  • Best practices

// Why Grafana

Grafana is the open-source standard for observability. From startups to Fortune 500 companies, teams use Grafana to understand their systems.

Whether you're monitoring servers, applications, or business metrics, Grafana makes data actionable.

See everything. Know everything.

// Tools & References

Grafana Documentation

Official Docs

grafana.com/docs

Prometheus

Metrics Database

prometheus.io

Grafana Labs

Official Website

grafana.com

Dashboards Gallery

Community Dashboards

dashboards

Plugin Directory

Grafana Plugins

grafana.com/plugins

PromQL Reference

Query Language

prometheus.io