View metrics

Metrics provide important information about the health of the apps in your cluster and the requests that reach your API Gateway. You can use these measures to detect failures, troubleshoot bottlenecks, and to find ways to improve the performance and reliability of your API Gateway.

The information in this guide assumes that you followed the get started tutorial to install Gloo Gateway, and deploy the Bookinfo app without Istio sidecars. As part of the steps on this page, you send requests to the product page app through your API Gateway and verify that metrics are collected for your API Gateway in Prometheus.

  1. Open the Prometheus UI.

  2. Send multiple requests to the reviews page.

    for ((i=1;i<=10;i++)); do curl -vik --resolve${INGRESS_GW_IP} ; done
    for ((i=1;i<=10;i++)); do curl -vik --resolve${INGRESS_GW_IP} ; done

  3. From the Prometheus dashboard, enter the following PromQL query to see the requests that were sent to the ingress gateway.

  4. Explore other queries that you run in the Prometheus dashboard to gain insight into your API Gateway.

Metric PromQL query
Request rate for Gloo Gateway rate(istio_requests_total{source_workload="istio-ingressgateway-1-18"}[5m])
Request rate between Gloo Gateway and a destination workload rate(istio_requests_total{source_workload="istio-ingressgateway-1-18", 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)

For more information about the built-in Prometheus, see the Prometheus server setup and the Prometheus observability tool overview.