Library for building Grafana dashboards
Project description
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/main/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.11.
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 currently don’t follow a roadmap for grafanalib and both maintainers <https://github.com/weaveworks/grafanalib/blob/main/MAINTAINERS> have recently become somewhat occupied otherwise.
We’d like you to join the grafanalib community! If you would like to help out maintaining grafanalib that would be great. It’s a fairly laid-back and straight-forward project. Please talk to us on Slack (see the links below).
We follow the CNCF Code of Conduct.
Getting Help
If you have any questions about, feedback for or problems with grafanalib:
Read the documentation at https://grafanalib.readthedocs.io
Invite yourself to the Weave Users Slack.
Ask a question on the #grafanalib slack channel.
Your feedback is always welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for grafanalib-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fab5d7b837a1f2d1322ef762cd52e565ec0422707a7512765c59f668bdceb58 |
|
MD5 | 0dd0e87e992f9768fe451c093491c5ca |
|
BLAKE2b-256 | d36e825081b0ae89031ec16de0c57bf6dbb06d26b69dc938c3461c831e409c9b |