Page MenuHomePhabricator

Programmatic generation of grafana dashboards
Open, MediumPublic

Description

At the moment all of our grafana dashboards are hand-edited, with some committed to puppet as per T133392.
The manual editing approach is ok but tedious and error prone especially when editing multiple dashboards. I've come across https://github.com/weaveworks/grafanalib before and it seems it could be a useful starting point to be able to write grafana dashboards as code instead.

Other alternatives include a jsonnet-based one: https://github.com/grafana/grafonnet-lib

And yaml based: https://github.com/jakubplichta/grafana-dashboard-builder or https://docs.openstack.org/infra/grafyaml/index.html

Javascript based: https://github.com/uber/grafana-dash-gen

Details

Related Gerrit Patches:
operations/puppet : productionWIP grafana: host overview dashboard as code

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 24 2017, 3:35 PM

OpenStack infrastructure has a python based utility to generate Grafana board based on a YAML DSL. That is similar to their Jenkins Job Builder used to generate jobs.

Basic usage: https://docs.openstack.org/infra/grafyaml/grafana-dashboard.html
Source code: https://git.openstack.org/cgit/openstack-infra/grafyaml

Their yaml files: https://git.openstack.org/cgit/openstack-infra/project-config/tree/grafana

The target definition seems to be one huge long line, but I am pretty sure they can be indented.

ema added a subscriber: ema.Jul 25 2017, 10:02 AM
Krinkle moved this task from Inbox to Grafana on the Graphite board.
Ottomata triaged this task as Medium priority.Jan 16 2018, 8:14 PM
Ottomata added a subscriber: Ottomata.

BTW, +1 for this. It'd be especially cool if we applied the same puppet profile in labs and got the same grafana dashboards there.

fgiunchedi moved this task from Backlog to Doing on the User-fgiunchedi board.Feb 1 2018, 1:40 PM
fgiunchedi updated the task description. (Show Details)Feb 6 2018, 4:05 PM
fgiunchedi updated the task description. (Show Details)Mar 22 2018, 10:59 AM
fgiunchedi updated the task description. (Show Details)Apr 20 2018, 2:55 PM

Change 442301 had a related patch set uploaded (by Filippo Giunchedi; owner: Filippo Giunchedi):
[operations/puppet@production] WIP grafana: host overview dashboard as code

https://gerrit.wikimedia.org/r/442301

CDanis added a subscriber: CDanis.Nov 14 2018, 5:39 PM
fgiunchedi moved this task from Doing to Up next on the User-fgiunchedi board.Dec 13 2018, 3:41 PM
fgiunchedi moved this task from Up next to Backlog on the User-fgiunchedi board.Oct 9 2019, 11:31 PM
fgiunchedi moved this task from Inbox to Backlog on the observability board.Dec 10 2019, 2:18 PM