Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 37 ยท Getting Started

Your First Dashboard

Build your first Grafana dashboard with the TestData data source: add a visualization, write a query, set a title and unit, save it in a folder and adjust the time range.

Time to build something. In this lesson you create a dashboard with two panels using the built-in TestData data source, so you need no other software. The steps apply unchanged when you later switch the queries to Prometheus or SQL.

Menu wording can differ slightly between Grafana versions. The sequence is always: create dashboard, add visualization, choose data source, write query, choose visualization type, set options, save.

Step 1: Create the dashboard

  1. Open the main menu, choose Dashboards, then New > New dashboard.
  2. Click Add visualization.
  3. Select the TestData data source (add it first under Connections > Data sources if it is missing).

You now see the panel editor: a preview on top, the query editor below, and the options pane on the right.

Step 2: Write a query

In the query editor, leave Scenario as Random Walk and set an Alias like server-1. Press Refresh (or Shift+Enter). A line appears in the preview.

Click Add query to add a second query with alias server-2. A panel can show many queries; each becomes a series.

Step 3: Choose the visualization

At the top right of the options pane, the default visualization is Time series. Keep it. Set:

  • Title: CPU load
  • Standard options > Unit: Misc > Percent (0-100)
  • Standard options > Min: 0

Click Back to dashboard.

Step 4: Add a second panel

Use Add > Visualization. Pick TestData, scenario Random Walk, then choose the Stat visualization and title it Current load. In Value options keep Calculation as Last. Stat shows one big number, perfect for "what is it right now".

Step 5: Arrange and save

  • Drag a panel by its title to move it and drag the bottom-right corner to resize. The layout snaps to a 24-column grid.
  • Click Save dashboard, give it the title My first dashboard, optionally pick a folder and press Save.

Congratulations, the dashboard now exists as a JSON document in Grafana's database. Open Dashboard settings > JSON Model to see it.

Step 6: Change time and refresh

Use the time picker (top right) to choose Last 15 minutes or an absolute range, and the refresh dropdown to reload every 5 s. Dashboard settings can also store a default range and refresh.

What the saved JSON looks like

The real JSON model is long, but its skeleton is simple. This stand-in builds a similar structure with a helper and checks that panels do not overlap on the grid, like Grafana's layout engine ensures.

JS Stand-in: build a dashboard model

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Panels, rows and the grid

Grafana's grid is 24 columns wide. A height unit is about 30 pixels. Panels with w: 12 take half the width. You can also create rows to group panels and collapse them, which is useful on big dashboards.

Stand-in: what Stat calculates

The Stat panel reduces a whole series to one value using a calculation: Last, Mean, Max, Min, Total and others. Try each reducer on a sample series.

JS Stand-in: reduce a series to one value

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Good habits from the start

  • Give every panel a clear title and a correct unit.
  • Put the most important panels at the top left.
  • Save often and write a short description in the save dialog; Grafana keeps version history you can restore from Dashboard settings > Versions.
  • Use tags and folders so people can find the dashboard.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. How wide is Grafana's dashboard grid?

    The grid has 24 columns; a panel with width 12 fills half the row.
  2. 2. Which visualization shows a single large current value?

    Stat reduces a series to one number using a calculation like Last or Mean.
  3. 3. Where can you see a dashboard's JSON?

    The JSON Model tab shows and lets you edit the saved document.
  4. 4. A single panel can contain...

    You can add many queries to one panel; they are drawn together.

Summary

  • New dashboard > Add visualization > choose data source > query > visualization > options > save.
  • TestData lets you practice with no external data.
  • The grid is 24 columns; panels can be dragged and resized.
  • Stat and Time series are the two most common starting panels.
  • Dashboards have version history and a JSON model.

Next: Core Concepts and the Data Model