Setting up Grafana(4.2)

This page describes how you can set up Grafana on your cluster to help visualize the metrics retrieved by the Prometheus server.

It also contains example dashboards both as zip and yaml-files that you can download with these links:

On Private Cloud and AWS

The steps for installing the Grafana tool using helm, as well as how to integrate it with your Usage Engine deployment, are described in this section. Before proceeding, see information on how to install Grafana using helm at https://github.com/grafana/helm-charts/tree/main/charts/grafana.

Before you install Grafana, it is recommended that you install the Prometheus server, see Setting up Prometheus(4.1).

The procedure described below is just one of many ways to install Grafana. The example provided uses the helm charts to install Grafana. However, you can install Grafana using any method you want.

Note!

If you have installed your Prometheus server in its own namespace, ensure that Grafana has access to the Prometheus server.

Installing Grafana without Persistence

The following steps describe how you install Grafana without the use of persistence, meaning that if your deployment goes down, the data is not retained. We do not recommend deploying Grafana without persistence in a production environment.

  1. Add the helm repo for Grafana by running the following command:

    helm repo add grafana https://grafana.github.io/helm-charts
  2. To view data in Grafana you need to create one or more "dashboards". You can create them manually in the Grafana GUI or use a yaml file to create them in advance. This yaml file, grafana-dashboards.yaml, includes three pre-created dashboards for pico statistics, workflows, and MIMs. You can also use your own yaml file with your own dashboard and data source configuration for this installation. You must link the Prometheus server as your data source.

  3. Install Grafana using the helm install command. This example shows how to install Grafana in its own namespace called Grafana. Enter the Grafana node port number. If you have another dashboard yaml file, you can replace the value by <dashboard yaml name>.

    helm install -n <namespace> grafana grafana/grafana \ --set service.type=NodePort \ --set service.nodePort=<port> \ -f ./<dashboard yaml name>

Example: helm install Grafana

helm install -n grafana grafana grafana/grafana \ --set service.type=NodePort \ --set service.nodePort=30090 \ -f ./grafana-dashboards.yaml

Installing Grafana with Persistence

The following steps show how to install Grafana using persistence volumes on your Kubernetes cluster.

  1. Create a yaml file and describe the Persistent Volume and Persistent Volume Claim for Grafana. The example below creates the persistent volume on an NFS file server that is mounted onto the cluster. The value set in nfs.path is the directory on the NFS file server that stores the data for Grafana.

  1. When the yaml file has been created, run this command:

  2. Add the helm repo for Grafana by running this command:

  3. To view data in grafana you need to create one or more "dashboards". You can create them manually in the Grafana GUI or import them from json based definition files. This zip file, grafana-dashboards.zip, includes three pre-created dashboards for pico statistics, workflows, and MIMs. You must link the Prometheus server as your data source.

  4. Install Grafana using the helm install command. In this example, Grafana is installed in its own namespace called grafana. Enter the Grafana node port number. Set the name of the Persistent Volume Claim created in the previous steps.
    If you have another dashboard yaml file, you can replace the value by <dashboard yaml name>.

Verify the Grafana Installation

This step describes how to check that your Grafana is deployed correctly.

  1. When Grafana has been installed you are given an export command that you can use to acquire the URL and the Port of the Grafana GUI. The command can look like this:

  1. To generate the URL from the result of the two export commands above, use this echo command. Then copy the result to your browser.

  1. Retrieve the password of the admin user for Grafana. After having installed Grafana, you are prompted with a message informing you how to retrieve the password. This is an example of how the command may look: