summaryrefslogtreecommitdiff
path: root/README.rst
blob: 85e294ab9ff161f59d469a4f15a0e16b64fc4958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
grafyaml
--------

At a glance
+++++++++++

* Free software: Apache license
* Documentation: http://docs.openstack.org/infra/grafyaml/
* Source: http://git.openstack.org/cgit/openstack-infra/grafyaml
* Bugs: https://storyboard.openstack.org/#!/project/818

Overview
++++++++

``grafyaml`` takes descriptions of `Grafana <https://grafana.com/>`__
dashboards in YAML format, and uses them to produce JSON formatted
output suitable for direct import into Grafana.

The tool uses the `Voluptuous
<https://github.com/alecthomas/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

.. code-block:: yaml

  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.

A large number of examples are available in the OpenStack
`project-config
<https://git.openstack.org/cgit/openstack-infra/project-config/tree/grafana>`__
repository, which are used to create dashboards on
`<http://grafana.openstack.org>`__.