You can monitor the CPU and memory usage of a Knative application. This topic describes how to configure the monitoring of these items.

Prerequisites

Procedure

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, click Prometheus Monitoring and click the ASK cluster that you want to manage.
    Note If you have not installed Prometheus, click Install on the Prometheus Monitoring page.
    98-ch
  3. On the Dashboards page, click Prometheus in the Name column.
  4. On the left side of the page that appears, click the Explore icon and select the ASK cluster from the Select datasource drop-down list.
    99
  5. Monitor the CPU usage of a Knative application.
    Enter the following PromQL statement into the Metrics text box. In this example, the helloworld-go application is queried. Click Run Query to query the CPU usage of the application.
    sum (rate (container_cpu_usage_seconds_total{pod_name=~"helloworld-go.*",namespace="default"}[1m])) 
    100
  6. Monitor the memory usage of a Knative application.
    Enter the following PromQL statement into the Metrics text box. In this example, the helloworld-go application is queried. Click Run Query to query the memory usage of the application.
    sum (rate (container_memory_working_set_bytes{pod_name=~"helloworld-go.*",namespace="default"}[1m])) 
    101