Read a resource's metrics
Chart the metrics of an instance, a database, a VPN connection, a Kubernetes cluster, a CDN distribution or an app's deployments, or read the datapoints over the API.
Last updated 18 November 2026View as Markdown
Replace i-1a2b3c4d with the id of the resource, as dcloud monitoring metrics resources lists
it. For what each metric means, see Metrics.
Prerequisites
- Permission for
monitoring:GetMetricDataonrn:ews::<organization id>:monitoring:*. Without it, the console's charts say "Metrics need monitoring:GetMetricData. Ask an administrator." - To list the resources and their metrics,
monitoring:ListMetrics. - In the console, also the permission that opens the resource's own page in its service.
Read the metrics
- Open the resource's page in its service: an instance, a Managed PostgreSQL database, a Document Database cluster, a Kubernetes cluster or a CDN distribution, and choose its Monitoring tab. For an app, choose Metrics; a site-to-site VPN connection's charts are with the connection on its gateway's page.
- Choose a range: 1 hour, 6 hours, 24 hours, 7 days or 14 days.
- A database with several nodes, or an app with machines, has one button per node or machine; choose the one to chart. An app's first button, Deployments, charts its deployments.
The charts show the average per period. With monitoring:DescribeAlarms, the alarms on the
resource are listed under the charts.
dcloud monitoring metrics get-data --resource-type instance --resource-id i-1a2b3c4d \
--metrics cpu_percent,network_in_bps --start 2026-10-29T10:00:00Z --period 300 --statistic maxGET /monitoring/api/metrics/data?resourceType=instance&resourceId=i-1a2b3c4d&metrics=cpu_percent,network_in_bps&start=2026-10-29T10:00:00Z&period=300&statistic=maxResult
The answer has one series per metric, each a list of { ts, value } for the periods that have
data; empty periods are left out. A metric the resource type does not record, and an id your
organization does not have, answer empty series rather than an error.
Limits
- 1 to 8 metrics per request.
statisticisavg(the default),maxormin;sumandcountare accepted but answer the average.periodis a whole number of minutes, from 60 to 86400 seconds (60 by default), and the range may hold at most 1440 periods. A longer range is refused with400"period: At most 1440 points per series: widen the period or narrow the range".startmust be beforeend(which defaults to now). Points are kept 14 days.
Related
Did this page help you?