Commit Graph

116 Commits

Author SHA1 Message Date
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
Zuul 53a0ccadb3 Merge "Use fixed datasource UID" 2022-06-30 00:35:32 +00:00
Ian Wienand 1db873f6f4 Use fixed datasource UID
As described inline, datasources now have a UID.  Set this to a fixed
hash of the URL to make dashboards which refer to datasources
explicitly portable.

Change-Id: I53e2aec7f635e8ce8793abb5755eccd2e6b3e4c5
2022-06-29 14:51:38 +10:00
Ian Wienand 72080f7136 Strip id/uid from .json input
As noted inline, a default export from Grafana includes the uid/id
which breaks when you re-import it into a different site.  Strip them.

Change-Id: I318614b33aed2ece93d44e832bad7907724cb1bc
2022-03-11 13:38:45 +11:00
Ian Wienand 2c3823432d Generate and use UID for acessing dashboards
We are relying on the "slug" field being the same as our "url
friendly" title that we create.  For whatever reason the slug field
was deprecated in Grafana v5.0, and now with v8.3.4 it has stopped
working.

We can turn the name/slug into a UID by hashing, and then use this in
the various API calls.

Change-Id: I13d3162c917e094684756e51836d12000621fefa
2022-01-25 10:59:28 +11:00
Zuul 39d8bd1d84 Merge "Add import of json files" 2021-05-07 01:31:49 +00:00
James E. Blair b89ec19088 Build docker images
This builds and publishes docker images to opendevorg/grafyaml
so that users can run this with "docker run ...".

Also, appease the pep8 gods.

Change-Id: Ia30438953e5c73a01ae0cd32afb660442e0e6e39
2021-03-11 14:15:37 -08:00
Ian Wienand 5f785f7782 Add import of json files
This simply takes any json files present and loads them into Grafana
directly.  The idea is that you can edit the dashboards using the
inbuilt editor, then copy the dashboard JSON and keep it externally
version controlled.  No parsing or validation is done on the JSON
files; we are assuming they have not been hand-modified from what
Grafana generates.

Change-Id: I38695aed2404f8b7fc350d949b7a9212498c35cb
2020-06-25 15:04:14 +10:00
Ian Wienand 92ef419c01 Remove query variable refresh deprecation
Added with dd6582e9cc, we have found
that setting a bool here means the query variable no longer refreshes
at all.  Thus it's dangerous to accept it, force it to be an int.

For reference, the values seem to be

 0 = never refresh
 1 = on load
 2 = on timeseries change

Change-Id: Ia96f0166a80ece0b307acdca20eeca045a2e4a75
2020-06-24 20:36:09 +00:00
Andy Ladjadj 67f55d53d6 Add capability to use grafana folderid parameter
- retro-compatibility with default folder 'General' == 0
 - add to config file with folderid key in grafana section
 - add to cmd with --grafana-folderid

Change-Id: Iebfc5613f4c622d3d49d2f34df77ad3695f6b046
2019-02-26 21:25:37 +00:00
Ian Wienand 53fea97346 Update valueName values
Over time there are more possible valueName options; this is taken
directly from the current list [1]

[1] 67d0bca3cb/public/app/plugins/panel/singlestat/module.ts (L24)

Change-Id: I010d5360ea7704af376a384330e1fc2e512e4c9a
2019-02-22 09:13:11 +11:00
Ian Wienand e6c7095c6b Add valueMaps and rangeMaps support
These allow you to specify custom text instead of displayed values

Change-Id: I7e5c6067c0b0d26edc18120283bad30887df0663
2019-02-21 10:06:35 +11:00
William Huang 60a4c15c9b Add prometheus data source
Change-Id: Ia56aa4e8015eacf8e21f78d3aba7f9822515b364
2019-02-12 16:45:23 +08:00
Ian Wienand 5463ff095e Add tooltip sort
You can sort the tooltips in descending (1) or ascending (2) order.

Change-Id: I931419f832b6fd4a537431e34c099e5f2884d4c2
2018-09-14 16:21:25 +10:00
Quique Llorente 2ffded73e9 Add panel type 'row'
Change-Id: I47ea73eab779fa311d22a930acdc33ac2a9230f8
2018-07-11 08:53:04 +02:00
Zuul 2ff186cae7 Merge "Add 'database' to the datasource schema" 2018-07-10 17:04:21 +00:00
Quique Llorente e36f4ef99e Add adhoc template variables
Change-Id: I884d9d54dedaaab586fa3c2e8228f40a2bd39d79
2018-07-10 16:19:58 +02:00
Zuul 0969e906f3 Merge "Add transparent" 2018-07-03 00:15:42 +00:00
Ian Wienand c82c2b8ef7 Add alerts to graphs
Graphs can setup alerts.  Add a basic framework for them.

Change-Id: I6a80041eaaa03a3b3ff3e3de76401bbc77f42e96
2018-06-12 13:04:25 +10:00
Ian Wienand a5d14a2faf Add transparent
Graphs can have a "transparent" attribute to make them
... transparent.

Change-Id: I7772943b92a0c46bc8d7cd5ae7255f4de774bdcf
2018-06-08 15:31:22 +10:00
Enrique Llorente abbef4e6b5 Add 'database' to the datasource schema
The database option is supported by influxdb type
but missing in the schema

Change-Id: Id993a8e31e6df4d6374ecccd16dfb6c70ea54c45
2018-06-04 07:55:58 +02:00
Eldad Marciano 2da2da1a9a Add datasource to template schema.
the following patch will allow us to use datasource type in template schema.

Change-Id: I15cce5f8f97d1837b94eaa7067d7ebe8e449f8f4
Signed-off-by: Eldad Marciano <emarcian@redhat.com>
2018-03-26 18:02:45 +03:00
Zuul e86eb350b3 Merge "Add Custom Template Type" 2018-03-20 21:01:16 +00:00
akrzos dd6582e9cc Add Custom Template Type
Allow custom templated vars.  Custom templated vars are similiar to
interval templated vars in that they have "options" however they can be
multi-selected vs just a singular selection as with an interval var.

Change-Id: Ic89c5d192f87890da950a9d2d5f9bc4a96a3e174
2018-03-16 12:44:22 +00:00
Zuul 8f729842b3 Merge "Add gauge caps for singlestat panel." 2018-03-15 02:56:39 +00:00
Eldad Marciano 08b4520efb Add gauge caps for singlestat panel.
Change-Id: Ic87e610cff0f2389464f8d744d7853a369939dc6
2018-03-12 19:03:01 +02:00
Eldad Marciano f1c684c1c2 Support formatting.
Adding format to schema base panel, in order to use graph unit e.g
bytes, precent, deckbytes etc.

Change-Id: I754596738970177bb70c5425d38e1291c56c84a9
2018-03-12 18:07:12 +02:00
Zuul ca98fba97f Merge "Add links to GrafYaml" 2018-02-16 20:09:40 +00:00
Zuul 8a525a916e Merge "Add more units for graph panel" 2018-02-16 20:05:31 +00:00
Zuul 9cf5fb52a9 Merge "Allow hidden templated vars" 2018-02-16 20:05:28 +00:00
Zuul 07e6ff97a2 Merge "Allow decimals to be specificed to limit decimals graphs" 2018-02-16 20:05:26 +00:00
Zuul e951216fc6 Merge "Allow repeating panels and to set minspan" 2018-02-16 20:05:24 +00:00
akrzos af54eb4eb1 Allow repeating panels and to set minspan
This allows dashboards that expand a templated var to multi-graphs

Change-Id: I9b78958d836bbd4f73b06d6c302124857863c3d2
2018-02-16 09:50:37 -05:00
akrzos 2c68efbb69 Allow decimals to be specificed to limit decimals graphs
This allows graphs tool tips to be limited by a decimal count.
Also fix forgotten validation on decimals setting specific to legends.

Change-Id: I5840b0081dbb17ead0c49fa7d6d6ba1a2e82bb7c
2018-02-16 09:50:00 -05:00
akrzos caad52ae85 Allow hidden templated vars
Change-Id: Id74fe2a8a7b7156e045fd0b1d3f232ac05964f53
2018-02-16 09:49:35 -05:00
akrzos 9faec6b923 Add more units for graph panel
* data (Metric) decimal units - decbits - decgbytes
* More data rate units
* More thoughput units

See this Grafana Source:
https://git.io/vAOKi

Change-Id: I24dc028ae67d95ed82ee6908b668cbaa37bf8d9b
2018-02-16 09:48:24 -05:00
akrzos 89e71ad53d Add links to GrafYaml
Allow dashboards with links to be created.

Change-Id: Ie6e27808e465d98fd6694a60b31aa78b883e7ed3
2018-02-16 09:47:44 -05:00
Fabien Boucher 28bbece7ae Unlock yaxes min limit and allow free value
Change-Id: Id942bfc9e06ad2b78bb8243ac06a089f6f2ab074
2018-02-16 14:27:31 +00:00
akrzos 4711e038ae Allow dashboards to be tagged
Change-Id: Ie1a7db10726a9de924a2a8fe262d2c9550d42fd5
2018-02-09 10:04:02 -05:00
Zuul 1f7fcdd161 Merge "Add yaxes format for newer versions of Grafana" 2018-02-09 14:11:40 +00:00
akrzos f4b52386cc Add yaxes format for newer versions of Grafana
y_formats has moved to yaxes, but still support y_formats

Change-Id: Iabd1302352c77dc82c543412596e21550e4c0579
2018-02-08 09:15:09 -05:00
akrzos a53ce0ed3b Add support to change the default time filter range
Default is 6h it seems.  This change allows adjusting the default
to/from range in the time filter.

Change-Id: I567b9cc5cd8c753f852066c9e6868dd0f1b30b60
2018-02-07 20:23:07 -05:00
akrzos 2cee4f2908 Add Grafana URL and API Key to GrafYaml CLI
This will allow the use of GrafYaml called from Ansible without
deploying a GrafYaml config file.  With Ansible we can use the template
module to deploy a jinja2 templated GrafYaml dashboard for more
flexibility.

Change-Id: I61a7142c3177681681dcbfe5c889f4c3d59f8ec4
2018-01-15 09:17:05 -05:00
Zuul f56133eafc Merge "Add support for influxdb datasource" 2018-01-12 20:45:31 +00:00
akrzos 96cf8f97d4 Add legend for graphs
Simple support for a legend on graphs.

Change-Id: I3dc96a1463a8e765b9c97fa2fd1550872d7a285f
2018-01-09 11:33:48 -05:00
Tristan Cacqueray 1af7a4e010 Add support for influxdb datasource
Change-Id: I8d4b073cdc3fec4e55d10fac014874003d3739b6
2017-12-08 01:55:46 +00:00
Jenkins fccc26d53b Merge "Add datasource option to more elements" 2017-04-02 20:02:11 +00:00
Iswarya_Vakati 91180e0476 Removes unnecessary utf-8 encoding
This patches removes unnecessary utf-8 encoding in
doc/source/conf.py
grafana_dashboards/__init__.py
tests/base.py
tests/schema/base.py
tests/schema/fixtures/dashboard-0010.yaml
tests/schema/fixtures/dashboard-0011.yaml
tests/schema/fixtures/dashboard-0012.yaml

Change-Id: I75b80ee943b4da7381e124743386c3ea6eb4db42
2017-01-11 05:27:12 +00:00
Ye Na Rhee f89102bbf9 Add datasource option to more elements
This change adds support for datasource option to:
* graph panel
* singlestat panel
* templating

This enables the user to use other datasource than the default datasource
for graph/singlestat panels and templating. It is useful when more
than one datasource are available in Grafana.

Change-Id: I2e81a2dc4658c530bf82c4b349e2991dad348b01
2016-08-11 20:19:12 -04:00
Mathieu Gagné 0941f4e3b0 Add support for multiple config paths
Help messages mention support for multiple config paths separated by colons.
Yet this feature is not implemented. This change implements it.

Change-Id: Ieb99cba98c9cf775765eacd4ebadfbccfa815a65
2016-06-07 16:44:32 -04:00