All Products
Search
Document Center

Application Real-Time Monitoring Service:Create a custom Grafana dashboard

Last Updated:Mar 11, 2026

Application Real-Time Monitoring Service (ARMS) stores application monitoring data in Managed Service for Prometheus, which is fully compatible with open-source Grafana and PromQL. This lets you build custom Grafana dashboards that combine ARMS application metrics with data from any Prometheus-compatible source -- giving you a unified view of application health, infrastructure, and business metrics.

Use cases

  • Build a unified operations dashboard that combines application metrics with infrastructure or business metrics from other data sources

  • Create peak-hour dashboards that correlate application performance with upstream and downstream service metrics

  • View ARMS Application Monitoring data in a self-managed Grafana instance alongside your existing dashboards

  • Query ARMS metrics programmatically through the Prometheus HTTP API for custom reporting or automation

  • Use ARMS Application Monitoring data for secondary development based on your business requirements

How it works

When you enable Application Monitoring for an application, ARMS automatically creates a free Prometheus instance in the same region. For example, an application monitored in the China (Hangzhou) region stores its metrics in a Prometheus instance named arms_metrics_cn-hangzhou_cloud_hangzhou.

image

To visualize these metrics in Grafana, add the Prometheus instance as a data source, then create panels that query the metrics with PromQL or the Grafana query builder.

Prerequisites

Before you begin, make sure that you have:

  • An ARMS agent installed for your application. For details, see Application Monitoring overview

  • One of the following Grafana environments:

    • A self-managed Grafana installation (local or on a server)

    • A Managed Service for Grafana workspace

Step 1: Add ARMS as a data source in Grafana

Managed Service for Prometheus integrates with Application Monitoring by default. To visualize the data in Grafana, add the Prometheus instance that stores your application metrics as a data source.

Choose one of the following paths based on your Grafana environment.

Add a data source to self-managed Grafana

Get the Prometheus HTTP API URL

  1. Log on to the ARMS console. In the left-side navigation pane, choose Managed Service for Prometheus > Instances. In the top navigation bar, select the region where your application is deployed. Instances with the type Prometheus Instance for Application Monitoring store the monitoring data for applications in that region.

    2024-10-29_11-56-55

  2. Click the instance name, then click Settings in the left-side navigation pane to view the HTTP API URL.

    2024-10-29_11-59-24

  3. (Optional) Click Generate Token to create an authentication token for the Prometheus instance. The token secures data access when Grafana reads from this instance.

    Important

    After you generate a token, you must include it as a custom HTTP header when adding this data source. Otherwise, Grafana cannot read data from the instance.

Configure the data source in Grafana

This example uses Grafana 10.x. For other versions, see Grafana documentation.

  1. Log on to Grafana as an administrator.

  2. Hover over the image icon in the upper-left corner and click Data sources.

  3. Click Add data source and select Prometheus.

  4. On the Settings tab, configure the following fields:

    FieldValue
    NameA descriptive name for this data source
    Prometheus server URL (in the HTTP section)The HTTP API URL obtained in the previous step

    image

  5. (Optional) If you generated an authentication token, add it as a custom header: in the Custom HTTP Headers section, click + Add header. Set Header to Authorization and Value to the token.

    image

  6. Click Save & test to verify the connection.

Add a data source to Managed Service for Grafana

Managed Service for Grafana provides a one-click integration for ARMS Application Monitoring data.

  1. Log on to the ARMS console. In the left-side navigation pane, choose Managed Service for Grafana > Workspace Management. Click the workspace ID.

  2. On the Workspace Information page, in the Cloud Service Integration section, click ARMS Application Monitoring. Find the Prometheus instance in the target region and click Integrations in the Actions column.

  3. Click OK in the confirmation dialog box.

  4. After the integration is complete, click Folder in the Actions column.

  5. On the Dashboards tab, click a dashboard name to view the preset Application Monitoring dashboard.

    Application Monitoring dashboard

  6. To verify the data source, hover over the image icon in the upper-left corner and click Data sources.

    2024-10-29_17-35-10

Step 2: Create a custom dashboard

  1. Hover over the image icon in the upper-left corner and click Dashboards.

  2. Click New Dashboard, then click Add an empty panel.

  3. In the Select data source dialog box, select the data source. The default naming format is arms_metrics_{regionid}_cloud.

    Important

    Verify that the data source contains data before proceeding. If no data appears, confirm that your application is actively reporting metrics.

  4. Configure the query using one of the following methods:

    Write a PromQL query (Code mode)

    Switch to Code mode and enter a PromQL expression next to Metrics browser.

    image.png

    Tip: To find the PromQL expression for a specific metric, go to the application details page in the Application Monitoring module and click the image icon next to the metric. For details, see Application overview.

    image

    For PromQL syntax reference, see Prometheus documentation.

    Select a metric visually (Builder mode)

    In Builder mode, select a metric from the Metric drop-down list. For example, select arms_jvm_threads_count to query the number of JVM threads.

    Use the Label filters section to narrow results by specifying labels and values.

    Use query

    For a full list of available metrics, see Application monitoring metrics.

  5. On the Panel tab (right side), set the panel title and select a chart type.

    Note

    Different chart types for the same metric can reveal data at different granularities.

    image.png

  6. Click Apply in the upper-right corner to save the panel to the dashboard.

Query metrics through the Prometheus HTTP API

In addition to Grafana dashboards, ARMS metrics are accessible through the Prometheus HTTP API. This enables automated reporting, custom alerting, and integration with your own tools.

Build a query URL

Combine the Prometheus HTTP API URL (from Step 1) with a PromQL expression using this format:

<Prometheus-HTTP-API-URL>/api/v1/query_range?query=<PromQL>&start=<startTime>&end=<endTime>&step=<step>

Query parameters

ParameterDescriptionExample
queryA PromQL expressionarms_jvm_threads_count{pid="xxx"}
startStart time as a Unix timestamp (seconds)1728719399
endEnd time as a Unix timestamp (seconds)1728722999
stepQuery resolution step60s

Authentication

If token-based authentication is enabled on the Prometheus instance, include the authentication token as an Authorization header in your HTTP request. Shell scripts, Python, Java, or any HTTP client can execute these queries.

Example

The following URL queries the total request count for an application, grouped by call type:

https://cn-hangzhou.arms.aliyuncs.com:9443/api/v1/prometheus/7a8f8e783c66a44a0f6a1dc9a0b8f1/1277589232893727/arms-metrics-99214ff7de7d0b2d/cn-hangzhou/api/v1/query_range?query=sum by (callType,)(sum_over_time_lorc(arms_app_requests_count_ign_destid_endpoint_ppid_prpc{pid="ckv8e2vzfj@7e393063f3fd6ad",serverIp=~".*",callKind=~"http|rpc|custom_entry|server|consumer|schedule",source="apm", }[1m]))&start=1728719399&end=1728722999&step=60s

The query returns data similar to the following:

image

FAQ

Is there a charge for querying data?

No. Data queries are free of charge.

Are there rate limits for PromQL queries?

Throttling protection is available but does not limit queries per second (QPS) directly. To avoid timeouts, keep your query rate below 50 QPS and avoid expensive queries such as querying all operations or retrieving data older than 30 days. If you need sustained high-volume queries, submit a ticket to request a higher quota.

What's next