Skip to main content

Building Your First Dashboard

Now that you've learned how to connect data sources and write queries in Grafana, it's time to put everything together and build your first functional dashboard. In this lesson, you'll create a complete monitoring dashboard from scratch, combining multiple panels and layouts to display meaningful insights from your data.

Learning Goals

  • Create and configure dashboard panels with different visualization types
  • Organize panels using Grafana's layout system
  • Apply dashboard settings and save your work
  • Use time range controls effectively
  • Share and export your dashboard

Creating Your First Dashboard

Start by navigating to the main Grafana interface and click the "+" icon in the sidebar, then select "Dashboard." You'll be presented with an empty dashboard canvas with a single "Add new panel" button.

tip

Grafana automatically saves your work as you build, but remember to manually save with a descriptive name when you're finished to ensure your dashboard is properly stored.

Adding Your First Panel

Click "Add new panel" to open the panel editor. Here's where you'll configure your data source, query, and visualization settings.

Configuring Data Source and Query

Select your previously configured data source (like Prometheus, MySQL, or the TestData DB we set up earlier). For this example, we'll use the TestData DB:

Example query for TestData DB
SELECT 
time as time,
value as value
FROM test_data
WHERE scenario = 'random_walk'

For Prometheus users, here's an equivalent example:

Example Prometheus query
rate(http_requests_total[5m])

Choosing Visualization Types

Grafana offers various visualization types. Let's start with a simple Time series graph:

  1. In the panel editor, go to the "Visualization" tab
  2. Select "Time series" from the visualization dropdown
  3. Customize the appearance with colors, line styles, and axis labels
Example panel configuration
{
"type": "timeseries",
"title": "Request Rate",
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {
"drawStyle": "line",
"lineWidth": 2
}
}
}
}

Building a Multi-Panel Dashboard

A good dashboard contains multiple panels that provide different perspectives on your data. Let's add several common panel types:

Stat Panel for Key Metrics

Add a new panel and choose "Stat" visualization:

Stat panel query
SELECT 
AVG(value) as average_value
FROM test_data
WHERE $__timeFilter(time)

Configure the stat panel to show:

  • Value: Last (for current value)
  • Stat: Average (for the time range)
  • Color mode: Background (for visual impact)

Table Panel for Detailed Data

Tables are great for showing precise values and multiple dimensions:

Table panel query
SELECT 
time,
value,
metric_name
FROM test_data
WHERE $__timeFilter(time)
ORDER BY time DESC
LIMIT 100

Gauge for Threshold Monitoring

Gauges help visualize values against predefined thresholds:

Gauge panel query
SELECT 
MAX(value) as current_value
FROM test_data
WHERE $__timeFilter(time)

Configure threshold values (like 80 for warning, 90 for critical) in the panel settings.

Dashboard Layout and Organization

Using Grid Layout

Grafana uses a flexible grid system for panel arrangement:

  1. Drag panels to reposition them
  2. Resize panels by dragging their edges
  3. Use the grid guidelines to align panels neatly
note

Panels automatically snap to the grid, making it easy to create clean, organized layouts without precise manual positioning.

Row Organization

For complex dashboards, use rows to group related panels:

  1. Click "Add panel" → "Add row"
  2. Give the row a descriptive title (like "Application Metrics")
  3. Add panels within the row
  4. Collapse rows to save space when not needed

Dashboard Settings and Time Range

Configuring Dashboard Properties

Access dashboard settings by clicking the gear icon:

  • General: Set dashboard title, description, and tags
  • Variables: Configure dynamic filters (we'll cover this in detail later)
  • Links: Add navigation links to related dashboards
  • Versions: View and restore previous versions

Time Range Controls

The time picker in the top right controls the time range for all panels:

  • Use relative time ranges (like "Last 6 hours")
  • Set absolute time ranges for specific periods
  • Use auto-refresh for real-time monitoring
Example time range configuration
From: now-1h
To: now
Refresh: 30s

Saving and Sharing

Saving Your Dashboard

Click the save icon (floppy disk) or press Ctrl+S:

  1. Enter a descriptive dashboard name
  2. Add tags for easier organization and search
  3. Choose a folder (default is "General")
  4. Click "Save"

Exporting and Importing

Export your dashboard as JSON for backup or sharing:

  1. Go to Dashboard Settings → JSON Model
  2. Copy the JSON or use the "Export" button
  3. Import via the "+" → "Import" option

Common Pitfalls

  • Overcrowding: Avoid putting too many panels on one dashboard. Split into multiple focused dashboards instead.
  • Missing context: Always include panel titles and units. Don't assume users know what metrics represent.
  • Ignoring time zones: Ensure your dashboard time zone matches your data source and user expectations.
  • Hard-coded values: Use dashboard variables instead of hard-coded filters for flexibility.
  • Poor color choices: Use accessible color schemes and maintain consistency across panels.

Summary

You've successfully built your first Grafana dashboard! You learned how to create different types of panels, organize them effectively, configure dashboard settings, and save your work. Remember that good dashboards tell a story about your system's health and performance, so focus on clarity and relevance when choosing what to display.

Show quiz
  1. What is the first step when creating a new dashboard in Grafana?

    • A) Configure data sources
    • B) Add a new panel
    • C) Set time range
    • D) Save the dashboard
  2. Which visualization type is best for showing values against predefined thresholds?

    • A) Time series
    • B) Stat
    • C) Gauge
    • D) Table
  3. How can you group related panels together in a dashboard?

    • A) Using folders
    • B) Creating rows
    • C) Changing panel colors
    • D) Adding tags
  4. What keyboard shortcut saves your dashboard in Grafana?

    • A) Ctrl+C
    • B) Ctrl+V
    • C) Ctrl+S
    • D) Ctrl+D
  5. Why should you avoid overcrowding your dashboard with too many panels?

    • A) It slows down Grafana
    • B) It makes the dashboard difficult to read and use
    • C) It uses too much storage
    • D) It requires more RAM

Answers:

  1. B) Add a new panel
  2. C) Gauge
  3. B) Creating rows
  4. C) Ctrl+S
  5. B) It makes the dashboard difficult to read and use