Your first dashboard and panels

Grafana · Essentials · 12 min

Dashboards are what most people use Grafana for, and a few good habits make them readable from day one.

Create a dashboard with Dashboards, New, New dashboard, Add visualization, and pick the data source. The panel editor has three areas: the preview, the query section below it, and the visualization options on the right.

For Prometheus the query editor has a Builder mode (pick metric, labels and operations) and a Code mode for typing PromQL. Useful query options:

  • Legend: {{instance}} or {{status}} to name series by label instead of the full label set.
  • Min step / interval and Type (range, instant, both). Stat and table panels often need instant queries.

Common visualizations: Time series for trends, Stat for one big number with a sparkline, Gauge and Bar gauge for values against limits, Table for lists, Heatmap for histogram distributions.

The dashboard's time picker (top right) sets the range for every panel, such as "Last 6 hours", plus an auto-refresh interval. Drag panels to arrange them and group them in collapsible rows.

Save the dashboard into a folder with a meaningful name. Each save creates a version you can compare and restore under Settings, Versions. Start with a few signals that answer "is the service healthy?" (traffic, errors, latency) rather than every metric you have.

Example

# Panel 1: Time series "Requests per second", legend {{status}}
sum by (status) (rate(http_requests_total{job="api"}[$__rate_interval]))

# Panel 2: Stat "Error ratio", unit Percent (0.0-1.0), instant query
sum(rate(http_requests_total{job="api", status=~"5.."}[5m]))
  / sum(rate(http_requests_total{job="api"}[5m]))

# Panel 3: Time series "p95 latency", unit seconds
histogram_quantile(0.95,
  sum by (le) (rate(http_request_duration_seconds_bucket{job="api"}[$__rate_interval])))

# Panel 4: Stat "Targets up", instant query
sum(up{job="api"})

Remember

  • Panels = query + visualization + options
  • Use legend templates like {{status}} and instant queries for stats
  • Save into folders; every save is a restorable version

Watch out for

  • One dashboard with 60 panels of every metric; nobody can read it during an incident.

Check yourself

  1. Which visualization best shows the current error ratio as one large number?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: grafana.com/docs/grafana/latest/dashboards/build-dashboards/create-dashboard/