Authors: Jitendra Singh (Jitendra.Singh4@ibm.com), Rishika Kedia (rishika.kedia@in.ibm.com), Vibha Kulkarni (vibha.kulkarni@in.ibm.com), Niha Tahoor M Niha.Tahoor.Mohammed@ibm.com)
Administrators often desire the ability to craft their unique queries and design customized Grafana dashboards. However, the Grafana instances that come with the monitoring stack, along with their dashboards, are limited to read-only access. To address this limitation, we can leverage the community supported Grafana operator from the Red Hat OperatorHub. Since the community operator default is an x86-based Grafana image, this blog describes the creation of a custom image tailored for IBM Z / IBM LinuxONE (s390x).
Navigate to OperatorHub and select the community powered Grafana Operator.

Click on Continue to accept the disclaimer, proceed with Install, and press Subscribe to accept the default configuration values and deploy to the openshift-logging namespace.

The Grafana operator will be shown in the openshift-logging namespace.

From Installed Operators, select the Grafana Operator. For the Grafana resource, press Create Instance to create a new Grafana instance using below YAML file as by default it doesn’t point to s390x (IBM Z / IBM LinuxONE) based docker image for Grafana.

In the Grafana instance YAML, make a note of the default username and password to log in, and press Create.

Connecting Prometheus to our Custom Grafana
The final step is to connect the community supported Grafana in the `openshift-logging` namespace to OpenShift monitoring in the `openshift-monitoring` namespace.
The `grafana-serviceaccount` service account has to be created alongside the Grafana instance. We will grant it the cluster-monitoring-view cluster role to the same.

The bearer token for this service account is used to authenticate access to the Prometheus instance running in the `openshift-monitoring` namespace. The following list of commands will help:
Create Grafana service account with the yaml content shown below


Create the Grafana-sa-token yaml file with below contents:


Create a Grafana Data Source instance by navigating to the Grafana operator -> GrafanaDataSource tab. Click on Create GrafanaDataSource Instance and navigate to the YAML view.

In the below YAML, substitute ${BEARER_TOKEN} with the output of the command above, copy the YAML shared below, and press Create.


From the `openshift-logging namespace`, navigate to Networking -> Routes and click on the Grafana <URL> to display the custom Grafana user interface.

Click on ‘Sign In’ from the bottom left menu of Grafana, and log in using the default username and password configured earlier.

Now, an editable Grafana interface appears, and you can view your custom Grafana dashboards or create your own.
Summary
After having the Grafana-dashboard enabled, you can start the creation of custom queries against the built-in Prometheus, allowing us to extract pertinent metrics and construct custom dashboards for visualization; see these
various examples.
