Managed Service for Prometheus offers several ways to query metric data. This topic describes how to query metrics in the Alibaba Cloud console, Grafana, and from a self-managed Prometheus instance.
Prerequisites
You have activated Managed Service for Prometheus and connected at least one integration. For more information, see Manage integrations.
Query metrics on the console
Log on to the ARMS console.
-
In the left-side navigation pane, click Integration Management.
-
On the Integration Management page, click the Integrated Environments tab, select the target instance and click its name to open the details page.

-
On the details page, click the Metrics Explorer tab.
-
In the Explore section, enter a metric name, add a key-value pair in the Labels text box and click Run query in the upper-right corner of the page.
Note-
In the
area, select a time range. By default, the query returns data from the last hour. -
Click + Operations to add a built-in PromQL function, such as sum(), irate(), or absent(). For more information, see the official open source Prometheus documentation.
-
Click Code to switch to PromQL input mode. For more information about PromQL syntax, see the official open source Prometheus documentation.
-
Query metrics in Grafana
Managed Service for Prometheus provides an HTTP API endpoint that you can use to add Prometheus monitoring data to Grafana or retrieve it through the Prometheus API for custom development. For more information, see Add Prometheus data to Grafana.
Query metrics in self-managed Prometheus
Managed Service for Prometheus provides a standard remote read interface, which allows you to query its monitoring data from a self-managed Prometheus instance. For more information, see Use a remote read endpoint to access cloud data from a self-managed Prometheus instance.