monitoring.metrics.get-data

Datapoints of up to eight metrics of one resource, one per period

GET /monitoring/api/metrics/dataIAM monitoring:GetMetricDataRead

metrics is comma-separated. start and end are ISO 8601; end defaults to now. period is seconds, a whole number of minutes; at most 1440 points per series. Metrics are kept 14 days.

Request syntax

GET /monitoring/api/metrics/data

Query parameters

  • resourceTypeRequired

    enum

    instance, db_node, vpn_connection, eks_cluster, cdn_distribution, app: as resources lists it

    One of: instance, db_node, vpn_connection, eks_cluster, cdn_distribution, app

  • resourceIdRequired

    string

    The resource’s id as resources lists it (i-… for an instance, a uuid otherwise): 1–64 letters, digits and dashes. An id the organization does not have answers empty series, not 404

  • metricsRequired

    string

    Comma-separated, 1–8 names, up to 400 characters, each one of cpu_percent, disk_read_iops, disk_write_iops, disk_read_bps, disk_write_bps, network_in_bps, network_out_bps, disk_used_percent, connections, replication_lag_bytes, query_slowdown, docdb_up, tunnel_up, tunnel_in_bps, tunnel_out_bps, bgp_prefixes, api_available, control_plane_ready, nodes_ready, nodes_not_ready, cdn_requests, cdn_cache_hits, cdn_cache_misses, cdn_hit_ratio, cdn_bytes_out, cdn_origin_bytes, waf_blocked, waf_counted, waf_challenged, waf_rate_limited, deploy_duration_seconds, deploys_succeeded, deploys_failed. A metric the resource type does not record answers no points

  • startRequired

    string

    ISO 8601; must be before end

  • endOptional

    string

    ISO 8601; now when omitted

  • periodOptional

    number

    Seconds per point, a whole number of minutes from 60 to 86400 (default 60). (end − start) / period may be at most 1440, else 400

    Constraints: integer

  • statisticOptional

    enum

    How the minutes of a period are combined: avg (default), max, min, sum or count

    One of: avg, max, min, sum, count

Response

200 with { start, end, period, statistic, series }: series has one entry per requested metric, { metric, label, unit, points }, and points are { ts, value } for the periods that have data (empty periods are left out). 400 when the range would give more than 1440 points.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow monitoring:GetMetricData on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud monitoring metrics get-data --resource-type instance --resource-id example --metrics example --start example

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_monitoring_metrics_get-data.