All Products
Search
Document Center

Managed Service for Prometheus:Use an intelligent detector to detect data anomalies

Last Updated:Dec 12, 2023

Managed Service for Prometheus uses an intelligent detector to identify abnormal fluctuations of KPI time-series data. This helps you make informative decisions in automatic data loss protection and root cause analysis if alerts occur. This topic describes how to use an intelligent detector to identify abnormal data fluctuations of a Prometheus instance on a Grafana dashboard.

Detect abnormal data fluctuations of a Prometheus instance

  1. Log on to the Managed Service for Prometheus console.
  2. In the left-side navigation pane, click Monitoring List. The Prometheus Service page appears.
  3. Find the Prometheus instance and click the link in the Grafana Workspace column.

  4. In the left-side navigation pane, click the ce icon. In the upper-left corner of the page, select a data source from the drop-down list to the right of Explore.

  5. Select a metric from the Metrics drop-down list to view the time-series data of the metric. For example, you can select the following metric whose data anomalies you want to view:

    arms_cms_collector_duration_seconds
  6. In the text box on the right of the Metrics drop-down list, enter the following PromQL statement. The statement is used as a sample anomaly detector. This way, the abnormal data fluctuations about the metric over a specific period of time can be identified.

    anomal_detect (arms_cms_collector_duration_seconds[180m],3)
    Note
    • arms_cms_collector_duration_seconds: the name of the metric used in the previous step. You can replace it based on your business scenario.

    • The data type of the metric that the PromQL statement queries must be range vector. Therefore, you must append a time selector to the right of the metric name. The default value of the time selector is [180m]. The default value of the parameter is 3. If you execute other aggregate functions in advance, you must modify the time selector to [180m:] in the PromQL statement. This way, you can change the data type of the metric to range vector. For example, you can modify the PromQL statement to anonym_detect (sum(node_memory_free_bytes)[180m:],3).