Skip to main content

Library for building Grafana dashboards

Project description

Documentation Status

Do you like Grafana but wish you could version your dashboard configuration? Do you find yourself repeating common patterns? If so, grafanalib is for you.

grafanalib lets you generate Grafana dashboards from simple Python scripts.

How it works

Take a look at the examples directory, e.g. this dashboard will configure a dashboard with a single row, with one QPS graph broken down by status code and another latency graph showing median and 99th percentile latency.

In the code is a fair bit of repetition here, but once you figure out what works for your needs, you can factor that out. See our Weave-specific customizations for inspiration.

You can read the entire grafanlib documentation on

Getting started

grafanalib is just a Python package, so:

$ pip install grafanalib

Generate the JSON dashboard like so:

$ curl -o
$ generate-dashboard -o frontend.json


This library is in its very early stages. We’ll probably make changes that break backwards compatibility, although we’ll try hard not to.

grafanalib works with Python 3.6 through 3.9.


If you’re working on the project, and need to build from source, it’s done as follows:

$ virtualenv .env
$ . ./.env/bin/activate
$ pip install -e .

Configuring Grafana Datasources

This repo used to contain a program gfdatasource for configuring Grafana data sources, but it has been retired since Grafana now has a built-in way to do it. See


We’d like you to join the grafanalib community! Talk to us on Slack (see the links), or join us for one of our next meetings):

We follow the CNCF Code of Conduct.

Getting Help

If you have any questions about, feedback for or problems with grafanalib:

Your feedback is always welcome!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for grafanalib, version 0.5.12
Filename, size File type Python version Upload date Hashes
Filename, size grafanalib-0.5.12-py3-none-any.whl (44.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size grafanalib-0.5.12.tar.gz (38.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page