amazonka-cloudwatch-2.0: Amazon CloudWatch SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.CloudWatch.ListMetrics

Description

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

Creating a Request

data ListMetrics Source #

See: newListMetrics smart constructor.

Constructors

ListMetrics' 

Fields

  • dimensions :: Maybe [DimensionFilter]

    The dimensions to filter against. Only the dimensions that match exactly will be returned.

  • includeLinkedAccounts :: Maybe Bool

    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.

  • metricName :: Maybe Text

    The name of the metric to filter against. Only the metrics with names that match exactly will be returned.

  • namespace :: Maybe Text

    The metric namespace to filter against. Only the namespace that matches exactly will be returned.

  • nextToken :: Maybe Text

    The token returned by a previous call to indicate that there is more data available.

  • owningAccount :: Maybe Text

    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.

  • recentlyActive :: Maybe 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.

Instances

Instances details
ToHeaders ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Methods

toHeaders :: ListMetrics -> [Header] #

ToPath ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

ToQuery ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

AWSPager ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

AWSRequest ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Associated Types

type AWSResponse ListMetrics #

Generic ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Associated Types

type Rep ListMetrics :: Type -> Type #

Read ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Show ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

NFData ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Methods

rnf :: ListMetrics -> () #

Eq ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Hashable ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

type AWSResponse ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

type Rep ListMetrics Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

type Rep ListMetrics = D1 ('MetaData "ListMetrics" "Amazonka.CloudWatch.ListMetrics" "amazonka-cloudwatch-2.0-9xq2AWTkbYo3pEtgQNn4jD" 'False) (C1 ('MetaCons "ListMetrics'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dimensions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [DimensionFilter])) :*: (S1 ('MetaSel ('Just "includeLinkedAccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "metricName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "namespace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "owningAccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "recentlyActive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RecentlyActive))))))

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.

Constructors

ListMetricsResponse' 

Fields

  • metrics :: Maybe [Metric]

    The metrics that match your request.

  • nextToken :: Maybe Text

    The token that marks the start of the next batch of returned results.

  • owningAccounts :: Maybe [Text]

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic ListMetricsResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Associated Types

type Rep ListMetricsResponse :: Type -> Type #

Read ListMetricsResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Show ListMetricsResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

NFData ListMetricsResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

Methods

rnf :: ListMetricsResponse -> () #

Eq ListMetricsResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

type Rep ListMetricsResponse Source # 
Instance details

Defined in Amazonka.CloudWatch.ListMetrics

type Rep ListMetricsResponse = D1 ('MetaData "ListMetricsResponse" "Amazonka.CloudWatch.ListMetrics" "amazonka-cloudwatch-2.0-9xq2AWTkbYo3pEtgQNn4jD" 'False) (C1 ('MetaCons "ListMetricsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "metrics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Metric])) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "owningAccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.