View metrics

Metrics provide important information about the health of the apps in your service mesh. You can use these measures to detect failures, troubleshoot bottlenecks, and to find ways to improve the performance and reliability of your service mesh.

The information in this guide assumes that you followed the getting started tutorials to install Gloo, install Istio in the workload clusters, and deploy the Bookinfo app. As part of the steps on this page, you send requests to the product page app and verify that metrics are collected for your workloads in Prometheus.

  1. Open the Prometheus UI.

  2. Set up port forwarding for the product page of the Istio Bookinfo app.

    kubectl -n bookinfo port-forward deploy/productpage-v1 9080 --context $REMOTE_CONTEXT1
  3. Send multiple requests to the product page. Each request to the product page requires the product page to collect data from other Bookinfo microservices. For each request, metrics are automatically sent to the Prometheus server.

    for ((i=1;i<=10;i++)); do curl -I -k "http://localhost:9080/productpage"; done
  4. From the Prometheus UI, enter the following PromQL query to see how many requests the product page's Envoy proxy in cluster1 sent to other Bookinfo microservices.

    sum(istio_requests_total{source_workload="productpage-v1"}) by (workload_id,destination_workload_id, response_code)
  5. Explore other queries that you run in the Prometheus UI to gain insight into your service mesh.

Metric PromQL query
Request rate for a given service rate(istio_requests_total{destination_app="<service_ID>"}[5m])
Request rate between source and destination workload rate(istio_requests_total{source_workload="<source_workload>", destination_workload="<workload_ID>"}[5m])
Successful request rate to a destination workload rate(istio_requests_total{response_code=~"[2-3].*", destination_workload="<workload_ID>"}[5m])
Rate of failing requests to a destination workload rate(istio_requests_total{response_code=~"[4-5].*", destination_workload="<workload_ID>"}[5m])
Number of new requests within a certain timeframe sum(increase(istio_requests_total{}[5m])) by (workload_id, destination_workload_id)