Chapter 2. Configuring observability metrics
The Connectivity Link example dashboards and alerts use metrics exported by Connectivity Link, Gateway API, and OpenShift components to provide insight into your Gateways, applications, and APIs. This section explains how to configure these metrics and set up these dashboards and alerts on your OpenShift cluster.
The example dashboards and alerts for observing Connectivity Link functionality use low-level CPU and network metrics from the user monitoring stack in OpenShift and resource state metrics from Gateway API and Connectivity Link resources. The user monitoring stack in OpenShift is based on the Prometheus open source project.
You must perform these steps on each OpenShift cluster that you want to use Connectivity Link on.
Prerequisites
- You have Connectivity Link installed as described in Installing Connectivity Link on OpenShift.
- You have monitoring for user-defined projects set up as described in the OpenShift monitoring documentation.
- You have Grafana installed and configured on your OpenShift cluster. For a community-based example, see Installing Grafana on OpenShift for Kuadrant Observability.
- You have cloned the Kuadrant Operator GitHub repository.
Procedure
Verify that user workload monitoring is configured correctly in your OpenShift cluster as follows:
kubectl get configmap cluster-monitoring-config -n openshift-monitoring -o jsonpath='{.data.config\.yaml}'|grep enableUserWorkload
kubectl get configmap cluster-monitoring-config -n openshift-monitoring -o jsonpath='{.data.config\.yaml}'|grep enableUserWorkload
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The expected output is
enableUserWorkload: true
.Install the Connectivity Link, Gateway, and Grafana component metrics and configuration as follows:
kubectl apply -k https://github.com/Kuadrant/kuadrant-operator/config/install/configure/observability?ref=v1.1.0
kubectl apply -k https://github.com/Kuadrant/kuadrant-operator/config/install/configure/observability?ref=v1.1.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow From the root directory of your Kuadrant Operator repository, configure the OpenShift
thanos-query
instance as a data source in Grafana as follows:TOKEN="Bearer $(oc whoami -t)" HOST="$(kubectl -n openshift-monitoring get route thanos-querier -o jsonpath='https://{.status.ingress[].host}')" echo "TOKEN=$TOKEN" > config/observability/openshift/grafana/datasource.env echo "HOST=$HOST" >> config/observability/openshift/grafana/datasource.env kubectl apply -k config/observability/openshift/grafana
TOKEN="Bearer $(oc whoami -t)" HOST="$(kubectl -n openshift-monitoring get route thanos-querier -o jsonpath='https://{.status.ingress[].host}')" echo "TOKEN=$TOKEN" > config/observability/openshift/grafana/datasource.env echo "HOST=$HOST" >> config/observability/openshift/grafana/datasource.env kubectl apply -k config/observability/openshift/grafana
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the example Grafana dashboards as follows:
kubectl apply -k https://github.com/Kuadrant/kuadrant-operator/examples/dashboards?ref=v1.1.0
kubectl apply -k https://github.com/Kuadrant/kuadrant-operator/examples/dashboards?ref=v1.1.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
- For information on how to configure metrics in OpenShift Service Mesh, see the OpenShift Service Mesh metrics documentation.
- For reference information on component metrics, see the Kuadrant metrics documentation.