Querying Metrics from Prometheus

    The sample application is used as the example application throughout this task.

    1. Verify that the service is running in your cluster.

      In Kubernetes environments, execute the following command:

    2. Send traffic to the mesh.

      For the Bookinfo sample, visit http://$GATEWAY_URL/productpage in your web browser or issue the following command:

      1. $ curl "http://$GATEWAY_URL/productpage"

      $GATEWAY_URL is the value set in the Bookinfo example.

    3. Open the Prometheus UI.

      In Kubernetes environments, execute the following command:

    4. Execute a Prometheus query.

      In the “Expression” input box at the top of the web page, enter the text:

      Then, click the Execute button.

    The results will be similar to:

    Prometheus Query Result

    You can also see the query results graphically by selecting the Graph tab underneath the Execute button.

    Prometheus Query Result - Graphical

    Other queries to try:

    • Total count of all requests to v3 of the reviews service:

      This query returns the current total count of all requests to the v3 of the reviews service.

    • Rate of requests over the past 5 minutes to all instances of the productpage service:

    The Prometheus addon is a Prometheus server that comes preconfigured to scrape Istio endpoints to collect metrics. It provides a mechanism for persistent storage and querying of Istio metrics.

    For more on querying Prometheus, please read their .

    • Remove any istioctl processes that may still be running using control-C or: