In practical scenarios, the number of concurrent pod requests is commonly used to
evaluate a Service. Knative collects request-related metrics by using the queue-proxy
container. This topic describes how to use Application Real-Time Monitoring Service
(ARMS) Prometheus to collect pod request-related metrics from a Knative Service.
Step 1: Install the Prometheus Monitoring component
- Log on to the ACK console.
- In the left-side navigation pane, choose .
- On the App Catalog page, click the Alibaba Cloud Apps tab and click ack-arms-prometheus.
- On the App Catalog - ack-arms-prometheus page, click the Parameters tab.
- On the Parameters tab, set parameter cluster_id.
Note
The system automatically sets the value to the ID of the target cluster. To find the
cluster ID, choose in the left-side navigation pane, find the target cluster on the Clusters page, and the cluster ID is displayed in the Cluster Name/ID column.
- On the App Catalog - ack-arms-prometheus page, go to the Deploy tab on the right, select the target cluster, and click Create.
Note Namespace and Release Name are set to arms-prom by default.
Step 2: Set collection job rules for the queue-proxy container
- Log on to the ARMS console.
- In the left-side navigation pane, click Prometheus Monitoring.
- On the Prometheus Monitoring page, click Settings in the Actions column.
- Click the Prometheus Settings tab, add the following content to the Prometheus.yaml file, and click Save.
global:
scrape_interval: 30s
scrape_timeout: 10s
evaluation_interval: 30s
scrape_configs:
- job_name: queue-proxy
scrape_interval: 3s
scrape_timeout: 3s
kubernetes_sd_configs:
- role: pod
relabel_configs:
# Rename metadata labels to be reader friendly
- source_labels: [__meta_kubernetes_pod_label_serving_knative_dev_revision, __meta_kubernetes_pod_container_port_name]
action: keep
regex: .+;http-autometric
- source_labels: [__meta_kubernetes_namespace]
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
target_label: pod
- source_labels: [__meta_kubernetes_service_name]
target_label: service
- Click the Metric tab to view the queue-proxy-related metrics.
Step 3: Query the number of concurrent pod requests
- In the left-side navigation pane of the cluster configuration page, click Dashboards.
- Click Prometheus in the Name column.
- On the left side of the Prometheus page, click the Explore icon.

- In the Metrics drop-down list, select queue to view queue-proxy-related metrics.
The
queue_requests_per_second metric is collected in this example.
You can also query the number of concurrent pod requests per second by specifying
the namespace, revision, and pod name. Example:
queue_requests_per_second{destination_configuration="helloworld-go",destination_namespace="default",destination_pod="helloworld-go-ttf52-deployment-5778d86bd6-dnxw2"}
