Page MenuHomePhabricator

Programmatic generation of grafana dashboards
Closed, DeclinedPublic

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

Event Timeline

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.

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.

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

lmata added a subscriber: herron.

@herron this sounds like should be folded into the Grizzly work or closed at this point. If you have opinions on either of these options or new options let me know :-)

Sounds good, yes grizzly deploys the jsonnet/grafonnet approach outlined in the task description and good progress has been made putting that in place.

At this point I think it would be helpful to talk about next steps, guidelines and workflows for transitioning general dashboards into the jsonnet model, and how this should interact with puppet (re: T171482#3904056 and similar)

Change 442301 abandoned by Filippo Giunchedi:

[operations/puppet@production] WIP grafana: host overview dashboard as code

Reason:

Obsolete

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

this is superseded by grizzly, which is already in production for SLO dashboarding