Health metrics
Health metrics
Abstract
Chapter 1. Health metrics Copy linkLink copied to clipboard!
You can use metrics to monitor the health of your components.
See the following documentation:
1.1. Using the metrics service Copy linkLink copied to clipboard!
You can use metrics to monitor component health across Red Hat Advanced Cluster Management for Kubernetes. Many custom metrics are documented in the Metrics chronicle overview.
1.1.1. Accessing the hub cluster metrics service Copy linkLink copied to clipboard!
To view the collected metrics, you must expose the metrics service on the hub cluster. If your metrics are already exposed in the Grafana dashboard, this procedure is optional.
From the OpenShift Container Platform console, find the metrics service. Click Observe > Metrics.
If you do not see the metrics in the Grafana dashboard, Grafana Explorer, or in the OpenShift Container Platform console, Prometheus might not be configured to scrape metrics. Continue with Scrapping with Prometheus to expose your metrics.
1.1.2. Scraping with Prometheus Copy linkLink copied to clipboard!
You can use Prometheus to expose metrics that are not exposed from the product console. See the procedures for both the hub and managed cluster metrics.
1.1.2.1. Scraping the hub cluster Copy linkLink copied to clipboard!
See the following procedure to expose metrics for the hub cluster. These files are within the openshift-monitoring namespace:
Create a
ServiceMonitorfor collecting services and exposing metrics. See the following YAML example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Rolefor setting the permissions for monitoring. See the following YAML file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
RoleBindingfor binding the role to the Prometheus monitoringServiceAccount, as it is in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify, run the following query in the dashboard to find metrics that are reported by the Subscription Operator Metrics Service:
{service="hub-subscription-metrics"}{service="hub-subscription-metrics"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.1.2.2. Scraping the managed cluster Copy linkLink copied to clipboard!
See the following procedure to expose metrics for managed clusters. These files are within the openshift-monitoring namespace:
Create a
ServiceMonitorfor collecting services exposing metrics. See the following YAML file example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply your file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Rolefor setting the permissions for monitoring. See the following YAML file example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
RoleBindingfor binding theRoleto the Prometheus monitoringServiceAccount:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify in the
Prometheusdashboard by running the following query to find metrics that are reported by the Subscription Operator Metrics Service:{service="mc-subscription-metrics"}{service="mc-subscription-metrics"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.1.3. Scraping the standalone cluster Copy linkLink copied to clipboard!
Create a
ServiceMonitorfor collecting services exposing metrics:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Rolefor setting the permissions for monitoring:oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
RoleBindingfor binding theRoleto the Prometheus monitoringServiceAccount. See the following YAML file example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to apply the file:
oc apply -f
oc apply -fCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify in the
Prometheusdashboard by running the following query to find metrics that are reported by the Subscription Operator Metrics Service:{service="standalone-subscription-metrics"}{service="standalone-subscription-metrics"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow