Commit Graph

188 Commits

Author SHA1 Message Date
Clark Boylan 0a344201a2 Move grafyaml to Bookworm and python 3.11
This updates python testing to py311, adjusts the trove identifiers to
match, and switches the docker file to using python3.11 on Bookworm.

The motivation behind this is once OpenDev has updated all services to
Bookworm and python3.11 the old bullseye images and images for older
python versions can be cleaned up.

Change-Id: I3dde845ba05bfec915e19c44959c187162254204
2023-09-19 11:06:20 -07:00
Clark Boylan fda05305bd Move from testr to stestr
Running `python setup.py test` and similar commands is no longer
supported by setuptools. These rely on testr anyway which has been
replaced by stestr in most places. Just switch to using stestr to avoid
these problems.

Note that we drop the coverage tox target since that requires a bit more
effort to setup now, but this was not used in CI and probably isn't
super important for a tool like grafyaml. It can be added back in if a
need arises in the future.

Change-Id: I86039d1d143b0199285d9195a3582640d447b36e
2023-09-19 11:06:17 -07:00
Clark Boylan fee8026623 Revert "Migrate grafyaml container images to quay.io"
This reverts commit 5920a71130.
This reverts commit 757e2d24c8.

This is a partial revert as test fixups are left as is.

OpenDev is moving back to docker.io to preserve speculative container
image testing.

Change-Id: I5cf061211df28a596271a033fb4b8bb5916ab998
2023-05-24 13:50:08 -07:00
Clark Boylan 5920a71130 Fix up tag release container build jobs
This was missed when converting the per change updates to quay.io. We
should now be able to tag releases and update quay.io too.

Change-Id: Icb82428033d3f12688ff449338d4921ae59b8cbc
2023-05-10 13:23:59 -07:00
Clark Boylan 757e2d24c8 Migrate grafyaml container images to quay.io
This migrates the published container images to quay.io. We also update
the source of the python base image to quay.io.

Three tox.ini changes are made. The first is to stop skipping sdists
which skips all installation of the software entirely. This prevents
AUTHORS file generation which breaks the docs build. We also need to
stop using develop installs to ensure AUTHORS files get generated.
Third we replace the setup.py build_sphinx command with sphinx-build as
setup.py commands are deprecated and don't work properly with modern
setuptools.

Depends-On: https://review.opendev.org/c/opendev/system-config/+/881932
Change-Id: Ia738ee9553368464dc498e4e04e1389c6dfbb969
2023-05-08 10:33:18 -07:00
Clark Boylan ddd1845d00 Update Docker images to python 3.10
This updates the grafyaml docker images to python 3.10. We do this
because 3.10 has been shown to be quicker than 3.8. Also, 3.11 is coming
up soon and moving off of 3.8 will allow us to remove those images
before adding 3.11 which keeps to image build count to a more reasonable
number.

We update the voluptuous version to add python 3.10 support. In
particular collections.Mapping moved to collections.abc.Mapping.

Change-Id: I1514f5e1992cfe5dcdaa06133f5da7379599e57e
2022-10-14 16:36:05 -07:00
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
Clark Boylan 4a451287df Run pep8 and unittest jobs out of in repo config
This was specified in project-config but got stale there. We move the
config here so that we can specify up to date jobs that make sense.

Depends-On: https://review.opendev.org/c/openstack/project-config/+/861482
Change-Id: I460d06b23639fae2d1b8898ed35a4e6914367a86
2022-10-14 15:48:17 -07:00
Zuul 53a0ccadb3 Merge "Use fixed datasource UID" 2022-06-30 00:35:32 +00:00
Zuul c1b6f9f4d2 Merge "Strip id/uid from .json input" 2022-06-30 00:35:31 +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 8c973ef54b Test with project-config graphs
This uses the job from the dependent change to import and take
screnshots of graphs from project-config.  This job will pull from the
intermediate registry, hence to add opendev-buildset-registry.

Depends-On: https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/847128/
Change-Id: I175635543c1a1dfe8c29304be0ccd2a58c20aac3
2022-06-24 13:59:27 +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
Zuul 5b98241e36 Merge "Remove query variable refresh deprecation" 2020-06-25 04:00:47 +00: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
Ian Wienand 878b20898d Drop Python 2 support
This has bit-rotted as libraries have updated to Python 3 only.

Switch to hacking; some minor changes to regex-strings is all that is
required.

Drop py27 markers and move to Python 3 only.  Update requirements.

Depends-On: https://review.opendev.org/737666
Change-Id: Iabf201965129b3284166e1aedcb9f1c9d6109077
2020-06-24 11:52:23 +10:00
OpenDev Sysadmins ad1e1e3537 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:26:03 +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
melissaml 0c1dccc15b Removed older version of python3.4
Change-Id: I14773f94276b015c655cffe4d3ff0addf4e53714
Closes-Bug:  #1801855
2019-01-06 14:35:50 +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
Zuul 1d29156dde Merge "change default python 3 env in tox to 3.5" 2018-06-19 01:44:58 +00:00
Zuul a73d39daa8 Merge "Add alerts to graphs" 2018-06-19 01:44:57 +00:00
qingszhao 4c88f902c8 change default python 3 env in tox to 3.5
Change-Id: I71ca6994abfa7d3c1e84686c83d8471e200cf640
2018-06-15 08:33:19 +08: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
qingszhao 3e4f2e5ee3 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I0d7c93b0c7e48dd86f3e1591596ca6e10caff196
2018-06-12 00:41:17 +08: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
Ian Wienand 59247628c4 Update documentation
Add some expanded documentation on what grafyaml actually does to
README.rst

While we're here, fix this up to use openstackdocs theme and the
latest sphinx, as it was producing a bunch of warnings.

Change-Id: I570b44cb911cd48d53d62234426edeabb22b1469
2018-06-04 20:42:30 +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
Ian Wienand f02241f8de Test case for multiple targets with hidden
I was trying to figure out how to do multiple target calculations with
hidden targets.  I didn't see this explicitly tested for, so add it.

Change-Id: Ibbbb2810dd531e792f11c07946c21829fcdbe0a1
2018-06-04 15:53:39 +10: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