---
title: "Get CloudWatch metric data"
method: GET
path: "/aws/cloudwatch/metric"
tags: ["AwsCloudWatch"]
---

# Get CloudWatch metric data

`GET /aws/cloudwatch/metric`

## Request

- Base URL: `https://api.ravion.com`
- URL: `https://api.ravion.com/aws/cloudwatch/metric`
- Auth: HTTP bearer

Fetch CloudWatch metric data for a module instance UI metric. Resolves the AWS account from `awsAccountId` + `region`. Applies a short Redis cache (60s for ranges that end at `now`, 5 min for fixed ranges).

## Query parameters

- `awsAccountId` string, required
- `region` string, required
- `metricNamespace` string, required
- `metricName` string, required
- `statistic` string, required
- `period` integer, required
- `startTime` string, required
- `endTime` string, required
- `dimensions` string[], nullable
- `groupBy` string, nullable
- `groupValues` string[], nullable

## Response `200`

The request has succeeded.

- CloudWatchMetricDataResponse: Response payload for a CloudWatch metric query
  - `datapoints` CloudWatchMetricDatapoint[], required: Time-series datapoints, ordered by timestamp ascending. Empty when the request set `groupBy`: a grouped metric answers in `series` instead.
    - `max` number, double: Maximum value across the period — paired with `min` to render a band on line charts
    - `min` number, double: Minimum value across the period — paired with `max` to render a band on line charts
    - `timestamp` string, required: Datapoint timestamp in ISO 8601 format
    - `value` number, double, required: Primary metric value (the user-supplied statistic, e.g. Average)
  - `omittedSeries` integer: Present only when the request set `groupBy`: how many more values of the dimension had datapoints in the window but are not in `series`. A CloudWatch search sees at most 500 values, so for a dimension with more than that the count falls short. Always 0 with `groupValues`.
  - `series` AmpMetricSeries[]: Present only when the request set `groupBy`: one series per value of that dimension, labelled `{<groupBy>: <value>}` — the same shape a PromQL answer uses, so one chart component draws both. Holds the 10 series with the largest totals over the window, largest first, or with `groupValues` every one of those values' series, largest first. A value with no datapoints in the window is left out.
    - `datapoints` AmpMetricDatapoint[], required: Datapoints, ordered by timestamp ascending
      - `timestamp` string, required: Datapoint timestamp in ISO 8601 format
      - `value` number, double, required: Sample value at that timestamp
    - `labels` object, required: Prometheus label set identifying the series (e.g. `{pod: api-abc}`). Empty for fully-aggregated queries.
  - `unit` string, required: Display unit suffix for the metric, inferred server-side from the namespace + metric name (e.g. `%`, ``, `B`). Empty when unknown.

## Other responses

- `400`: The request is invalid or malformed.
- `404`: The server cannot find the requested resource.
- `422`: Client error
- `500`: Server error

---

[API](https://skmtc.dev/ravion/apis/ravion.md) - [All operations](https://skmtc.dev/ravion/apis/ravion/llms.txt) - [OpenAPI document](https://skmtc.dev/ravion/apis/ravion/revisions/66e5732205a0?raw)
