utility methods for building grafana scripted dashboards
Include this module in your scripted dashboard project
npm install --save graf-dash
(See
grafana_scripted_starter
for baseline project that utilizes CommonJS, npm, and a webpack build for
grafana scripted dashboards)
Grafana scripted dashboards can take param arguments. They will be made
available to the scope of your dashboard via an ARGS
property.
returns the value of key
on args
, or default
if the key is not found
getArg(key:string, default:*, args:object)
var getArg = require('graf-dash').getArg;
// passing in the `ARGS` object that grafana makes available
var controllerName = getArg('controller', 'users', ARGS);
buildRow(title:string, panels:array)
Takes a title and an array of panel objects and builds a row of panels
buildPanel(span:string, panel:object)
wrapWith(target:string, func:string, value:*)
Wraps an existing target in a graphite target (i.e. alias
)
- Fork it ( https://github.com/[my-github-username]/graf-dash/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request