Once you perform the steps described in Prerequisites, perform the steps below to add the Gnocchi data source to Grafana.
To add the Gnocchi data source:
Open your Git project repository with Reclass model on the cluster level.
In the stacklight/client.yml
file, add the following class:
- system.grafana.client.datasource.gnocchi
In the stacklight/server.yml
file, specify the following parameters,
where example.com
is the vhost FQDN:
docker_image_grafana: docker-prod-local.artifactory.mirantis.com/openstack-docker/grafana:stable
grafana_gnocchi_address: example.com
Log in to the Salt Master node.
Apply the following states:
salt 'mon*' state.sls docker.client
salt 'mon*' state.sls grafana.client
If the HTTP vhost name is not resolvable from the Docker container, run the
following command from the host that runs the container to add a record in
/etc/hosts
of Grafana containers:
GRAFANA_CONTAINER_ID=`docker ps | grep grafana | cut -d" " -f1`
HOST_IP=`hostname -I | cut -d " " -f1`
docker exec -u root -it $GRAFANA_CONTAINER_ID bash -c "echo \"$HOST_IP example.com\" >> /etc/hosts"
In the Grafana web UI, navigate to Configuration > Data Sources.
Open the Gnocchi data source and click Save & Test.