Introduction
With the Red Hat Advanced Cluster Management for Kubernetes (RHACM) observability service enabled, you can use RHACM to gain insight and optimize your managed clusters. This information can save cost and prevent unnecessary events.
When RHACM observability is installed, the metrics in managed clusters are collected and uploaded to the hub cluster. The default metrics that are collected are defined in the ConfigMap, observability-metrics-custom-allowlist
. There are also predefined Grafana dashboards in RHACM, so that you can observe all the managed clusters from the hub cluster easily.
The previously mentioned default metrics collection and dashboards may not satisfy users. In this blog series, I introduce how to customize your RHACM observability settings. This article introduces how to customize Grafana dashboards. More specifically, I demonstrate how to customize the metrics allowlist and alert rules.
Prerequisites
- You must install Red Hat Advanced Cluster Management for Kubernetes (RHACM)
- You must enable the RHACM observability service
Default grafana dashboards
RHACM observability provides the ability to monitor the health of your managed clusters. You can observe and manage clusters through Grafana dashboards. Access the Grafana dashboards through the URL, https://$ACM_URL/grafana
. The default Grafana dashboards are shown in the following image. See the source code in multicluster-observability-operator.
Customize the Grafana dashboards
RHACM observability also provides the ability to customize the Grafana dashboards. For example, the default dashboards do not show the average received container bandwidth, so you should add a dashboard and panel to observe that metric. Complete the following steps to design and create your own dashboard:
-
Clone the following repository, multicluster-observability-operator:
git clone git@github.com:open-cluster-management/multicluster-observability-operator.git
-
Set up the Grafana developer instance:
cd multicluster-observability-operator/tools
./setup-grafana-dev.sh --deploy -
Switch the user to be a Grafana admin. Navigate to the Grafana URL,
https://$ACM_URL/grafana-dev/
and log in. Then run the following command:./switch-to-grafana-admin.sh kube:admin
-
Design your Grafana dashboard. For more information, see Design your Grafana dashboard. Complete the following steps to create a dashboard:
-
From the Grafana console, create a dashboard by selecting the Add icon from the navigation panel. Hover your cursor over Create > Dashboard. Then click Add new panel:
-
Select the dashboard settings. From the General tab, define the dashboard name as
Custom Dashboard
.
-
From the Variables tab, add the variable name
datasource
and cluster provider, which is used in the dashboard query. Fill in the table as seen in the following image:
-
From the Custom Dashboard/Edit Panel view, navigate to the Query tab.
-
Configure your query by selecting Observatorium from the data source selector and enter a PromQL query:
avg(irate(container_network_receive_bytes_total{cluster="$cluster", namespace=~".+"}[$__interval])) by (namespace)
-
From the Grafana dashboard header, click the Save icon that is in the dashboard header.
-
Use the
generate-dashboard-configmap-yaml.sh
script to generate the dashboard ConfigMap, and to save the ConfigMap locally. Run the following command:# ./generate-dashboard-configmap-yaml.sh "Custom Dashboard"
Save dashboard <custom-dashboard> to ./custom-dashboard.yaml
For more information see, example/custom-dashboard.yaml for an existing custom dashboard.
-
So far, you can search and see a new dashboard named Custom Dashboard as shown in the following image:
Note: You may also see the panel has no data. This happens by default because the only metrics listed in observability-metrics-allowlist
are collected by the RHACM observability service. To collect more metrics for your custom dashboard, continue reading or follow Adding custom metrics from the product documentation.
Update the custom metrics allowlist
In this example, let's update the custom metrics allowlist for the example/observability-metrics-custom-allowlist.yaml
:
-
Add custom metrics with the following command:
oc create -f example/observability-metrics-custom-allowlist.yaml
-
View and explore data by navigating to the Grafana explore page, and search the collected metrics data. Your results might resemble the following image:
-
Let's go back to the Custom Dashboard dashboard to see that the data is available in the panel:
Summary
Throughout this blog, I have provided guidance to help you design your Grafana dashboard through the console. Remember to update the metrics allowlist if your dashboard is using a new metrics name. In the next article, I plan to introduce more on how to customize the metrics collection.
About the authors
Browse by channel
Automation
The latest on IT automation for tech, teams, and environments
Artificial intelligence
Updates on the platforms that free customers to run AI workloads anywhere
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
The latest on how we reduce risks across environments and technologies
Edge computing
Updates on the platforms that simplify operations at the edge
Infrastructure
The latest on the world’s leading enterprise Linux platform
Applications
Inside our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Customer support
- Developer resources
- Find a partner
- Red Hat Ecosystem Catalog
- Red Hat value calculator
- Documentation
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit