All Products
Search
Document Center

Use ARMS Prometheus Monitoring to monitor disks

Last Updated: Aug 25, 2021

After elastic container instances are created in a Kubernetes cluster, the instances run on the virtual node. Due to the absence of real nodes, disks are related to pods, instead of to nodes. You must configure pod-level monitoring of disks before you can monitor disk performance metrics. This topic describes how to use Application Real-Time Monitoring Service (ARMS) Prometheus Monitoring to monitor the disks attached to elastic container instances.

Prerequisites

A serverless Kubernetes (ASK) cluster is created and connected to ARMS Prometheus Monitoring. For more information, see Connect ASK clusters to ARMS Prometheus Monitoring.

Procedure

  1. Log on to the Container Service console.

  2. Go to the Grafana page.

    1. On the Clusters page, find the cluster that you want to monitor and click the cluster name.

    2. On the Cluster Information page, click Prometheus Monitoring in the upper-right corner.

    3. On the Prometheus Monitoring page, click Open in New Window in the upper-right corner.

  3. In the left-side navigation pane, click the icon and select Plus signImport.

  4. Click Upload JSON file to upload a JSON file.

    The JSON file contains dashboard configurations. For information about an example file, see Dashboard template for monitoring disks for pods.

  5. Set both the folder and data source of the dashboard to the cluster that you want to monitor.

    Disk monitoring 1
  6. Click Import.

    After the JSON file is imported, you can view monitoring data about disks on the elastic container instances.

    Disk monitoring 2

    On the Prometheus Monitoring page of the ARMS console, you can view the dashboard list of the cluster and find the dashboard that you created.

    Disk monitoring 3
  7. (Optional) To view Deployment- or StatefulSet-level monitoring data, you can copy the corresponding panel from the current disk monitoring dashboard to the monitoring dashboard of the Deployment or StatefulSet within the same cluster or modify the settings of the disk monitoring dashboard.

    When you modify the disk monitoring dashboard settings, perform the following steps to filter variables:

    1. On the Grafana page of the disk monitoring dashboard, click the icon in the upper-right corner. Settings

    2. In the left-side navigation pane of the Settings page, click Variables.

    3. Click New, configure parameters in the General and Query Options sections, and then click Add.

      When you add variables, set Query based on the variable types. The following table describes example Query settings for different variable types.

      Type

      Query

      deployment

      label_values(kube_deployment_created{namespace=~"$namespace"},deployment)

      statefulset

      label_values(kube_statefulset_created{namespace=~"$namespace"},statefulset)

      The following figure shows an example on how to add a variable named deployment.

      Disk monitoring 4
    4. Click the default variable named pod, modify Query on the Edit page, and then click Update.

      Modify Query based on the type of the variable added in the previous step. The following table describes example Query settings for different variable types.

      Type

      Query for the pod

      deployment

      query_result(kube_pod_info{namespace=~'$namespace',pod=~"$deployment.*"} >= 1)

      statefulset

      query_result(kube_pod_info{namespace=~'$namespace',pod=~"$statefulset.*"} >= 1)

    5. Adjust the order of variables until the deployment variable or a variable named statefulset is in a higher position than the pod variable.

      The following figure shows that the deployment variable is in a higher position than the pod variable.Disk monitoring 5

    6. Go back to the disk monitoring dashboard to check whether the filtering feature has taken effect.

      The following figure shows an example of the disk monitoring dashboard where the Deployment-level filtering feature has taken effect.

      Disk monitoring 6