All guides

Grafana dashboards that people read

Grafana's best-practice guide says a dashboard should tell a story or answer a question, and that it should reduce cognitive load. Its advice on signals, units, variables, links and version control follows.

Close-up of code on a screen in many colours

One question, one audience

Grafana's best-practice guide says a dashboard should tell a story or answer a question. If the dashboard has no goal, it says, ask whether you need it at all.

The guide asks you to check two things for the reader: whether it is obvious what each graph represents, and how long someone else would take to figure the dashboard out.

Put the answers on the dashboard itself:

  • Give it a meaningful name. The guide suggests your name or initials in the name or in a tag, so that people know who owns it.
  • Add a text panel with the purpose of the dashboard, useful links and instructions.
  • Fill in each panel's description, which appears on hover.

The golden signals on the top row

Grafana's guide lists the four golden signals as one of its monitoring strategies, with Google's SRE handbook as the origin:

  1. Latency: time taken to serve a request.
  2. Traffic: how much demand is placed on your system.
  3. Errors: rate of requests that are failing.
  4. Saturation: how full your system is.

Put them on the top row of every service dashboard. The guide's own example lays out the RED method with request and error rate on the left, latency on the right and one row per service. It asks for a logical progression of data, such as general to specific, so detail goes below.

Consistent units and axes

  • Set the Unit option on every panel. Grafana's documentation says a standard option applies to all fields or series.
  • Normalize axes. Grafana's example is CPU: measure by percentage, because machines have different numbers of cores.
  • Use the left and right Y-axes when one panel shows series with different units or ranges.
  • Use color with a meaning. Grafana's example: blue means good, red means bad.
  • Be careful with stacked graphs. The guide warns that they can be misleading and hide important data.
  • Avoid unnecessary refreshing. The guide's example: hourly data does not need a 30-second refresh rate.

Template variables

Grafana's guide says to prevent dashboard sprawl with template variables: you do not need a separate dashboard for each node when a query variable can select the node. Making the data source a variable too lets the same dashboard serve different clusters and monitoring backends.

For a Prometheus data source, create a variable of type Query and set its query type to Label values, with the label you want, such as job. The documentation marks the label_values() function syntax as deprecated. This is its example of a panel query that uses the variable:

PromQL

rate(http_requests_total{job=~"$job"}[$__rate_interval])

When Multi-value or Include All is enabled, the variable's value becomes a regular expression, so the matcher is =~. $__rate_interval is a Grafana variable for rate() and increase() that guarantees a window large enough for at least four scrape samples. http_requests_total is the documentation's metric. Use your own.

Grafana supports three kinds of link:

  • Dashboard links are displayed at the top of the dashboard, for links that relate to most or all of the panels. A dashboard link can also be a URL to an external system, so add your runbook's address as one. Two options carry the current time range and the variable values to the next dashboard.
  • Panel links are for drilling down into specific panels.
  • Data links are for drilling down into a specific series or a single measurement.

The best-practice guide adds two points: build hierarchical dashboards with drill-downs to the next level, and have most dashboards linked to by alerts.

Dashboards as code

Grafana's documentation says dashboards are represented as JSON objects, and its maturity model counts version-controlled dashboard JSON as progress. File provisioning loads that JSON from disk: add a YAML file to the provisioning/dashboards directory. This one is from the documentation:

YAML

apiVersion: 1
providers:
  - name: dashboards
    type: file
    updateIntervalSeconds: 30
    options:
      path: /etc/dashboards
      foldersFromFilesStructure: true

The path and the interval are the documentation's values. foldersFromFilesStructure creates Grafana folders from the folder names under path. With updateIntervalSeconds above 10, Grafana polls the path at that interval.

The provider option allowUiUpdates decides what the UI may do. Set to false, nobody can save changes to a provisioned dashboard. Set to true, a saved change lives in the database until the provisioning file changes, and then the file overwrites it.

The current documentation also describes Git Sync, which synchronizes dashboards with a Git repository in both directions, and the Foundation SDK for defining dashboards in code. It says Git Sync functionality is constantly evolving and that Grafonnet is not officially supported. It lists three dashboard JSON schema models: Classic, V1 Resource and V2 Resource.

What to review

  • Review dashboards periodically and remove the unnecessary ones. Grafana says sprawl makes the right dashboard harder to find.
  • Put TEST or TMP in the name of an experiment, and remove it when you are done.
  • Do not copy a dashboard to change one thing. Grafana says copies miss later updates to the original.
  • Do experiments in a separate Grafana instance.

Sources

Want a second pair of eyes on yours? We do this work for a living.

Book a call

More guides