Clark Boylan 7f9c7fdee2 Fix default handling with newer voluptious
It seems newer voluptuous passes the specified default value into the
verification method. Previously if data wasn't supplied it seems to have
not validated anything and returend the default. Anyway this means we
need to use a default value that matches our input type and manipulate
it on the output end the same way we would normal input.

We make this update in order to use newer voluptuous which will be
required when we switch to python3.10.

Change-Id: I64d9c8ac1334971f2d1c82f19ea675022635dc37
2022-10-14 16:35:05 -07:00
2020-06-25 15:04:14 +10:00
2022-03-11 13:38:45 +11:00
2019-04-19 19:26:03 +00:00
2015-05-04 13:14:07 -04:00
2015-05-04 13:14:07 -04:00
2015-05-04 13:14:07 -04:00
2021-03-11 14:15:37 -08:00
2015-05-04 13:14:07 -04:00
2015-05-04 13:14:07 -04:00
2015-05-04 13:14:07 -04:00
2020-06-25 15:04:14 +10:00
2020-06-24 11:52:23 +10:00
2020-06-24 11:52:23 +10:00
2020-06-24 11:52:23 +10:00
2020-06-24 11:52:23 +10:00

grafyaml

At a glance

Overview

grafyaml takes descriptions of Grafana dashboards in YAML format, and uses them to produce JSON formatted output suitable for direct import into Grafana.

The tool uses the Voluptuous data validation library to ensure the input produces a valid dashboard. Along with validation, users receive the benefits of YAML markup such as comments and clearer type support.

For example, here is a minimal dashboard specification

dashboard:
  time:
    from: "2018-02-07T08:42:27.000Z"
    to: "2018-02-07T13:48:32.000Z"
  templating:
    - name: hostname
      type: query
      datasource: graphite
      query: node*
      refresh: true
  title: My great dashboard
  rows:
    - title: CPU Usage
      height: 250px
      panels:
          - title: CPU Usage for $hostname
            type: graph
            datasource: graphite
            targets:
              - target: $hostname.Cpu.cpu_prct_used

grafyaml can be very useful in continuous-integration environments. Users can specify their dashboards via a normal review process and tests can validate their correctness.

The tool can also take JSON manually exported from the Grafana interface and load it as a dashboard. This allows keeping dashboards that have been edited with the inbuilt editor externally version controlled.

A large number of examples are available in the OpenStack project-config repository, which are used to create dashboards on http://grafana.openstack.org.

Description
Tools to make Grafana dashboards from templates
Readme 1.3 MiB
Languages
Python 99%
Dockerfile 1%