List the specified metrics¶
Description¶
List the specified metrics. You can use the returned metrics with get_metric_data or get_metric_statistics to get 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 for the metric to appear. To see metric statistics sooner, use get_metric_data or get_metric_statistics.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view metrics from the linked source accounts. For more information, see CloudWatch cross-account observability.
list_metrics doesn't return information about metrics if those metrics haven't reported data in the past two weeks. To retrieve those metrics, use get_metric_data or get_metric_statistics.
Usage¶
cloudwatch_list_metrics(Namespace, MetricName, Dimensions, NextToken,
RecentlyActive, IncludeLinkedAccounts, OwningAccount)
Arguments¶
-
NamespaceThe metric namespace to filter against. Only the namespace that matches exactly will be returned.
-
MetricNameThe name of the metric to filter against. Only the metrics with names that match exactly will be returned.
-
DimensionsThe dimensions to filter against. Only the dimension with names that match exactly will be returned. If you specify one dimension name and a metric has that dimension and also other dimensions, it will be returned.
-
NextTokenThe token returned by a previous call to indicate that there is more data available.
-
RecentlyActiveTo filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of
PT3H. This is the only valid value for this parameter.The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 50 minutes more than the specified time interval.
-
IncludeLinkedAccountsIf you are using this operation in a monitoring account, specify
trueto include metrics from source accounts in the returned data.The default is
false. -
OwningAccountWhen you use this operation in a monitoring account, use this field to return metrics only from one source account. To do so, specify that source account ID in this field, and also specify
trueforIncludeLinkedAccounts.
Value¶
A list with the following syntax:
list(
Metrics = list(
list(
Namespace = "string",
MetricName = "string",
Dimensions = list(
list(
Name = "string",
Value = "string"
)
)
)
),
NextToken = "string",
OwningAccounts = list(
"string"
)
)