Skip to main content

Library for building Grafana dashboards

Project description

===============================
Getting Started with grafanalib
===============================

.. image:: https://readthedocs.org/projects/grafanalib/badge/?version=latest
:alt: Documentation Status
:scale: 100%
:target: https://grafanalib.readthedocs.io/en/latest/?badge=latest

Do you like `Grafana <http://grafana.org/>`_ 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
<https://github.com/weaveworks/grafanalib/blob/master/grafanalib/tests/examples/>`_,
e.g. `this dashboard
<https://github.com/weaveworks/grafanalib/blob/master/grafanalib/tests/examples/example.dashboard.py>`_
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
<https://github.com/weaveworks/grafanalib/blob/master/grafanalib/weave.py>`_
for inspiration.

You can read the entire grafanlib documentation on `readthedocs.io
<https://grafanalib.readthedocs.io/>`_.

Getting started
===============

grafanalib is just a Python package, so:

.. code-block:: console

$ pip install grafanalib


Generate the JSON dashboard like so:

.. code-block:: console

$ 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:

.. code-block:: console

$ 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):

- Meetings take place monthly: fourth Friday of the month 15:00 UTC
- https://weaveworks.zoom.us/j/96824669060
- `Meeting minutes and agenda
<https://docs.google.com/document/d/1JxrSszyPHYhNbJDWYZehRKv6AO4U-zIBhuNmYQVOIHo/edit>`_
(includes links to meeting recordings)


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 <https://slack.weave.works/>`_.
- Ask a question on the `#grafanalib <https://weave-community.slack.com/messages/grafanalib/>`_ slack channel.
- `File an issue <https://github.com/weaveworks/grafanalib/issues/new>`_.

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.9.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

grafanalib-0.5.9-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grafanalib-0.5.9.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for grafanalib-0.5.9.tar.gz
Algorithm Hash digest
SHA256 837e7a29935e8eb48e70069752348783f4d0102fe70a73fb73c303a8ebfa88cf
MD5 416b0676f19f7f610e9cb13e734baec1
BLAKE2b-256 a5c20972d62edec32525f1b990aeaf7f9dfc26644587727ed61a5289bab5d743

See more details on using hashes here.

File details

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

File metadata

  • Download URL: grafanalib-0.5.9-py3-none-any.whl
  • Upload date:
  • Size: 40.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for grafanalib-0.5.9-py3-none-any.whl
Algorithm Hash digest
SHA256 337e1e152ee5ef6198e8c01ac0c6c752beafe0b3c9915280c8b297591ab59e0d
MD5 a25962c0212e030c9d5ce39d337bf863
BLAKE2b-256 852b5ecc0f34a8152b3f7afb60653bdf57eaf6baa303ea425461b0b636fa5ef4

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