2015-04-30 19:09:38 +00:00
|
|
|
:title: Grafana
|
|
|
|
|
|
|
|
.. _grafana:
|
|
|
|
|
|
|
|
Grafana
|
|
|
|
#######
|
|
|
|
|
|
|
|
Grafana is an open source, feature rich metrics dashboard and graph editor for
|
2015-11-15 12:39:58 +08:00
|
|
|
Graphite, InfluxDB & OpenTSDB. OpenStack runs Graphite which stores all the
|
2017-02-21 08:30:17 -05:00
|
|
|
metrics related to Nodepool and Zuul (to name a few).
|
2015-04-30 19:09:38 +00:00
|
|
|
|
|
|
|
At a Glance
|
|
|
|
===========
|
|
|
|
|
|
|
|
:Hosts:
|
2020-06-23 11:41:27 +10:00
|
|
|
* https://grafana.opendev.org
|
2015-04-30 19:09:38 +00:00
|
|
|
:Projects:
|
2020-06-23 11:41:27 +10:00
|
|
|
* https://grafana.org
|
2015-04-30 19:09:38 +00:00
|
|
|
:Bugs:
|
|
|
|
* https://storyboard.openstack.org/#!/project/748
|
|
|
|
|
|
|
|
Overview
|
|
|
|
========
|
|
|
|
|
2020-06-23 11:41:27 +10:00
|
|
|
Apache is configured as a reverse proxy to Grafana running in a
|
|
|
|
container, listening on port 3000.
|
2015-04-30 19:09:38 +00:00
|
|
|
|
|
|
|
|
2020-06-23 11:41:27 +10:00
|
|
|
Local Development
|
|
|
|
=================
|
|
|
|
|
|
|
|
To develop dashboards, you can run the OpenDev Grafana container.
|
|
|
|
Firstly, get setup:
|
|
|
|
|
|
|
|
.. code-block:: shell-session
|
|
|
|
|
|
|
|
$ cd <work dir>
|
|
|
|
$ mkdir secrets
|
|
|
|
$ echo "password" > secrets/admin_password
|
|
|
|
$ echo "admin" > secrets/admin_user
|
|
|
|
$ echo "key" > secrets/secret_key
|
|
|
|
|
|
|
|
$ git clone https://opendev.org/openstack/project-config
|
|
|
|
|
|
|
|
Then run the container with the following options:
|
|
|
|
|
|
|
|
.. code-block:: shell-session
|
2015-04-30 19:09:38 +00:00
|
|
|
|
2020-06-23 11:41:27 +10:00
|
|
|
$ cd <work dir>
|
|
|
|
$ sudo podman run \
|
|
|
|
-p 3000:3000 \
|
|
|
|
-v ./secrets:/etc/grafana/secrets \
|
|
|
|
-v ./project-config:/opt/project-config \
|
|
|
|
-e GF_AUTH_ANONYMOUS_ENABLED=true \
|
|
|
|
-e GF_USERS_ALLOW_SIGN_UP=false \
|
|
|
|
-e GF_SECURITY_ADMIN_PASSWORD__FILE=/etc/grafana/secrets/admin_password \
|
|
|
|
-e GF_SECURITY_ADMIN_USER__FILE=/etc/grafana/secrets/admin_user \
|
|
|
|
-e GF_SECURITY_SECRET_KEY__FILE=/etc/grafana/secrets/secret_key \
|
|
|
|
docker.io/opendevorg/grafana
|
2015-04-30 19:09:38 +00:00
|
|
|
|
2020-06-23 11:41:27 +10:00
|
|
|
At this point, Grafana will be running and listening on port 3000.
|
|
|
|
You can log into as ``admin`` with ``password`` (or using your secrets
|
|
|
|
above).
|
2015-04-30 19:09:38 +00:00
|
|
|
|
2020-06-23 11:41:27 +10:00
|
|
|
This is unconfigured and does not yet talk to the OpenDev Graphite
|
|
|
|
instance. The dashboard definitions are kept in
|
|
|
|
``project-config/grafana``. To load them ``exec`` the
|
|
|
|
``update-grafana`` script in the container (i.e. ``podman exec
|
|
|
|
<running-container> update-grafana``). That will run ``grafyaml`` and
|
|
|
|
load in the updated dashboards (note it relies on things being mapped
|
|
|
|
as above). To work on dashboards, update the ``yaml`` files in
|
|
|
|
``project-config`` and re-run ``update-grafana``, then reload them in
|
|
|
|
the Grafana UI.
|
2015-04-30 19:09:38 +00:00
|
|
|
|
2020-06-23 11:41:27 +10:00
|
|
|
Alternatively, you can use the Grafana editor to make the dashboards,
|
|
|
|
and then under "Dashboard Settings" (gear icon) select "JSON Model"
|
|
|
|
and commit that (it seems you have to cut-and-paste, there isn't
|
|
|
|
currently a way to export the JSON as such).
|