Page MenuHomePhabricator

Programmatic generation of grafana dashboards
Closed, DeclinedPublic


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

And yaml based: or

Javascript based:

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:
Source code:

Their yaml files:

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

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



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