Container Service for Kubernetes (ACK) clusters are compatible with Managed Service for Prometheus and Managed Service for Grafana, eliminating the need to build your own monitoring systems and dashboards. After deploying applications in Knative, you can import monitoring data from Knative to Managed Service for Prometheus and view real-time metrics such as response latency, request concurrency, CPU, and memory usage through Grafana dashboards.
Prerequisites
Knative has been deployed in your cluster. For more information, see Deploy Knative.
Managed Service for Prometheus has been activated for your cluster and the version of the Prometheus agent is later than 3.0.0. For more information, see Managed Service for Prometheus.
NoteFor more information about how to install Prometheus agent through the console, see Procedure.
Limits
Only Prometheus for Container Service instances can be connected to Knative.
Billing rules
After ingesting the Knative monitoring data to Managed Service for Prometheus, the corresponding components can automatically send monitoring metrics to Managed Service for Prometheus. These metrics are treated as custom metrics. Fees are charged for custom metrics.
Before you enable this feature, we recommend that you read Billing overview to understand the billing rules of custom metrics. The fees may vary based on the cluster size and number of applications. You can follow the steps in View resource usage to monitor and manage resource usage.
Connect Knative to Managed Service for Prometheus
Log on to the ARMS console.
In the left-side navigation pane, choose .
Click the name of the Prometheus instance instance that you want to manage to go to the Integration Center page.
In the uninstalled section of the Integration Center page, click Install in the Knative card.
NoteIf you have installed the Knative component, you can click Add in the Knative card on the Integration Center page to modify the parameters of the Knative component.
In the access Knative panel, configure Exporter Name and Metrics scrape interval (seconds) and click OK.
Parameter
Description
Exporter Name
The name of the Knative exporter.
Metrics space interval (seconds)
The interval at which you want the service to collect monitoring data.
View the Knative dashboard
In the Installed section of the Integration Center page, click the Knative card. In the Knative panel, click the Dashboards tab and click the dashboard image to view the detailed Knative monitoring data in Grafana.
Category | Description |
Request data | In the Overview section, you can view the number of Knative requests (Request Volume), request success rate (Success Rate), client errors (4xx), server errors (5xx), and pod scaling trend. Note The vertical axis ops/sec of the Request Volume, 4xx, and 5xx charts indicates the number of requests processed per second. |
Response latency data | In the Response Time section, you can view the response latency data of Knative, including the P50, P90, P95, and P99 response latency. |
Request concurrency data | In the Autoscaler section, you can view detailed information about the request concurrency of Knative. |
Resource usage | In the Resource Usages section, you can view the usage information of Knative resources, including CPUs and memory. |
View key service discovery metrics of Knative
Log on to the ARMS console. In the left-side navigation pane, choose
. On the Instances page, click the name of your Prometheus for Container Service instance. In the left-side navigation pane, click Service Discovery to view the Knative service discovery metrics. The following table describes the key service discovery metrics of Knative.When the number of pods for a Knative application is scaled to zero, metrics such as the request concurrency and the number of requests sent to a pod per second cannot be collected by Managed Service for Prometheus. You can view these metrics in the console only after you access the pods of the Knative application.
When the number of pods for a Knative application is not zero, you can directly view the metrics in the console, such as the request concurrency and the number of requests sent to a pod per second. You do not need to access the pods of the Knative application.
Metric | Description |
queue_average_concurrent_requests | The number of concurrent requests sent to a pod. |
queue_requests_per_second | The number of requests sent to a pod per second. |
revision_request_latencies | The response latency. |
revision_request_count | The number of revision requests. |
References
You can use Simple Log Service for log collection, monitoring and alerting. For more information, see Enable Simple Log Service on Knative and View alert events of Services.