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 readthedocs.io.

Getting started

grafanalib is just a Python package, so:

$ pip install grafanalib

Generate the JSON dashboard like so:

$ curl -o example.dashboard.py https://raw.githubusercontent.com/weaveworks/grafanalib/master/grafanalib/tests/examples/example.dashboard.py
$ generate-dashboard -o frontend.json example.dashboard.py

Support

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.

Developing

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 https://grafana.com/docs/administration/provisioning/#datasources

Community

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.

Source Distribution

grafanalib-0.5.12.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

grafanalib-0.5.12-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file grafanalib-0.5.12.tar.gz.

File metadata

  • Download URL: grafanalib-0.5.12.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for grafanalib-0.5.12.tar.gz
Algorithm Hash digest
SHA256 f7b15be6d7e8fa1840b988ad1cf889c98f18b12f6858c0fad028d64ed23b5d65
MD5 9a91935214e82c42c6817b3dcb6f7ae7
BLAKE2b-256 42d3ba39a6ef835d9d66824690a0702072359814e294a13e742ff0308778d531

See more details on using hashes here.

File details

Details for the file grafanalib-0.5.12-py3-none-any.whl.

File metadata

  • Download URL: grafanalib-0.5.12-py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for grafanalib-0.5.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e2197a6212d35f1a49f6fbcecbb05bf62c2f71264c022c077c5fbb287ee296d1
MD5 e436538cecce953e15bdb81e445b1226
BLAKE2b-256 b80d39c69985a4525bda7327d537b18c191f21b26d25400ace4562998ba4e249

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page