List the specified metrics. You can use the returned metrics with
GetMetricData or
GetMetricStatistics to obtain statistical data.
Up to 500 results are returned for any one call. To retrieve additional results,
use the returned token with subsequent calls.
After you create a metric, allow up to 15 minutes before the metric appears.
You can see statistics about the metric sooner by using GetMetricData or
GetMetricStatistics.
ListMetrics doesn't return information about metrics if those metrics haven't
reported data in the past two weeks. To retrieve those metrics, use
GetMetricData or
GetMetricStatistics.
example
Use a bare-bones client and the command you need to make an API call.
List the specified metrics. You can use the returned metrics with GetMetricData or GetMetricStatistics to obtain statistical data.
Up to 500 results are returned for any one call. To retrieve additional results, use the returned token with subsequent calls.
After you create a metric, allow up to 15 minutes before the metric appears. You can see statistics about the metric sooner by using GetMetricData or GetMetricStatistics.
ListMetrics
doesn't return information about metrics if those metrics haven't reported data in the past two weeks. To retrieve those metrics, use GetMetricData or GetMetricStatistics.Use a bare-bones client and the command you need to make an API call.
import { CloudWatchClient, ListMetricsCommand } from "@aws-sdk/client-cloudwatch"; // ES Modules import // const { CloudWatchClient, ListMetricsCommand } = require("@aws-sdk/client-cloudwatch"); // CommonJS import const client = new CloudWatchClient(config); const command = new ListMetricsCommand(input); const response = await client.send(command);
ListMetricsCommandInput for command's
input
shape.ListMetricsCommandOutput for command's
response
shape.config for CloudWatchClient's
config
shape.