Chapter 2. Metrics and Service Mesh
2.1. Using metrics Copy linkLink copied to clipboard!
You can use the OpenShift Container Platform monitoring stack and Red Hat OpenShift Service Mesh to track the health and performance of your applications. You can learn how to monitor metrics and alerts for both standard and ambient mesh modes.
2.1.1. About metrics Copy linkLink copied to clipboard!
Monitoring stack components are deployed by default in every OpenShift Container Platform installation and are managed by the Cluster Monitoring Operator (CMO). These components include Prometheus, Alertmanager, Thanos Querier, and others. The CMO also deploys the Telemeter Client, which sends a subset of data from platform Prometheus instances to Red Hat to facilitate Remote Health Monitoring for clusters.
When you have added your application to the mesh, you can monitor the in-cluster health and performance of your applications running on OpenShift Container Platform with metrics and customized alerts for CPU and memory usage, network connectivity, and other resource usage.
When you have added your application to the mesh in ambient mode, you can monitor the Istio standard metrics of your application from the ztunnel resource and the waypoint proxies. The ztunnel also exposes a variety of DNS and debugging metrics.
Ambient mode uses two proxy layers, which results in two types of metrics for each application service. You can collect Layer 4 (L4) TCP metrics from both the ztunnel and the waypoint proxies. You can collect Layer 7 (L7) metrics, such as HTTP traffic metrics, from the waypoint proxies.
2.1.2. Configuring OpenShift Monitoring with Service Mesh Copy linkLink copied to clipboard!
You can integrate Red Hat OpenShift Service Mesh with user-workload monitoring to enable observability in your service mesh. User-workload monitoring provides access to essential built-in tools and is required to run Kiali, the dedicated console for Istio.
Prerequisites
- Red Hat OpenShift Service Mesh is installed.
- User-workload monitoring is enabled. See Enabling monitoring for user-defined projects.
Procedure
Create a YAML file named
servicemonitor.ymlto monitor the Istio control plane:Example
ServiceMonitorobjectCopy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the YAML file by running the following command:
oc apply -f servicemonitor.yml
$ oc apply -f servicemonitor.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a YAML file named
podmonitor.ymlto collect metrics from the Istio proxies:Example
PodMonitorobjectCopy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the YAML file by running the following command:
oc apply -f podmonitor.yml
$ oc apply -f podmonitor.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow On the OpenShift Console go to Observe
Metrics, and run the query istio_requests_total.NoteThe Metrics implementation can take a few minutes for the query to return results.