Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
List the specified metrics. You can use the returned metrics with GetMetricData or GetMetricStatistics 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 GetMetricData or GetMetricStatistics.
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.
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.
This operation returns paginated results.
Synopsis
- data ListMetrics = ListMetrics' {}
- newListMetrics :: ListMetrics
- listMetrics_dimensions :: Lens' ListMetrics (Maybe [DimensionFilter])
- listMetrics_includeLinkedAccounts :: Lens' ListMetrics (Maybe Bool)
- listMetrics_metricName :: Lens' ListMetrics (Maybe Text)
- listMetrics_namespace :: Lens' ListMetrics (Maybe Text)
- listMetrics_nextToken :: Lens' ListMetrics (Maybe Text)
- listMetrics_owningAccount :: Lens' ListMetrics (Maybe Text)
- listMetrics_recentlyActive :: Lens' ListMetrics (Maybe RecentlyActive)
- data ListMetricsResponse = ListMetricsResponse' {}
- newListMetricsResponse :: Int -> ListMetricsResponse
- listMetricsResponse_metrics :: Lens' ListMetricsResponse (Maybe [Metric])
- listMetricsResponse_nextToken :: Lens' ListMetricsResponse (Maybe Text)
- listMetricsResponse_owningAccounts :: Lens' ListMetricsResponse (Maybe [Text])
- listMetricsResponse_httpStatus :: Lens' ListMetricsResponse Int
Creating a Request
data ListMetrics Source #
See: newListMetrics
smart constructor.
ListMetrics' | |
|
Instances
newListMetrics :: ListMetrics Source #
Create a value of ListMetrics
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
ListMetrics
, listMetrics_dimensions
- The dimensions to filter against. Only the dimensions that match exactly
will be returned.
$sel:includeLinkedAccounts:ListMetrics'
, listMetrics_includeLinkedAccounts
- If you are using this operation in a monitoring account, specify true
to include metrics from source accounts in the returned data.
The default is false
.
ListMetrics
, listMetrics_metricName
- The name of the metric to filter against. Only the metrics with names
that match exactly will be returned.
ListMetrics
, listMetrics_namespace
- The metric namespace to filter against. Only the namespace that matches
exactly will be returned.
ListMetrics
, listMetrics_nextToken
- The token returned by a previous call to indicate that there is more
data available.
$sel:owningAccount:ListMetrics'
, listMetrics_owningAccount
- When 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 true
for
IncludeLinkedAccounts
.
$sel:recentlyActive:ListMetrics'
, listMetrics_recentlyActive
- To 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 40 minutes more than the specified time interval.
Request Lenses
listMetrics_dimensions :: Lens' ListMetrics (Maybe [DimensionFilter]) Source #
The dimensions to filter against. Only the dimensions that match exactly will be returned.
listMetrics_includeLinkedAccounts :: Lens' ListMetrics (Maybe Bool) Source #
If you are using this operation in a monitoring account, specify true
to include metrics from source accounts in the returned data.
The default is false
.
listMetrics_metricName :: Lens' ListMetrics (Maybe Text) Source #
The name of the metric to filter against. Only the metrics with names that match exactly will be returned.
listMetrics_namespace :: Lens' ListMetrics (Maybe Text) Source #
The metric namespace to filter against. Only the namespace that matches exactly will be returned.
listMetrics_nextToken :: Lens' ListMetrics (Maybe Text) Source #
The token returned by a previous call to indicate that there is more data available.
listMetrics_owningAccount :: Lens' ListMetrics (Maybe Text) Source #
When 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 true
for
IncludeLinkedAccounts
.
listMetrics_recentlyActive :: Lens' ListMetrics (Maybe RecentlyActive) Source #
To 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 40 minutes more than the specified time interval.
Destructuring the Response
data ListMetricsResponse Source #
See: newListMetricsResponse
smart constructor.
ListMetricsResponse' | |
|
Instances
newListMetricsResponse Source #
Create a value of ListMetricsResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
ListMetricsResponse
, listMetricsResponse_metrics
- The metrics that match your request.
ListMetrics
, listMetricsResponse_nextToken
- The token that marks the start of the next batch of returned results.
$sel:owningAccounts:ListMetricsResponse'
, listMetricsResponse_owningAccounts
- If you are using this operation in a monitoring account, this array
contains the account IDs of the source accounts where the metrics in the
returned data are from.
This field is a 1:1 mapping between each metric that is returned and the ID of the owning account.
$sel:httpStatus:ListMetricsResponse'
, listMetricsResponse_httpStatus
- The response's http status code.
Response Lenses
listMetricsResponse_metrics :: Lens' ListMetricsResponse (Maybe [Metric]) Source #
The metrics that match your request.
listMetricsResponse_nextToken :: Lens' ListMetricsResponse (Maybe Text) Source #
The token that marks the start of the next batch of returned results.
listMetricsResponse_owningAccounts :: Lens' ListMetricsResponse (Maybe [Text]) Source #
If you are using this operation in a monitoring account, this array contains the account IDs of the source accounts where the metrics in the returned data are from.
This field is a 1:1 mapping between each metric that is returned and the ID of the owning account.
listMetricsResponse_httpStatus :: Lens' ListMetricsResponse Int Source #
The response's http status code.