Amazon CloudWatch

2026/09/24 - Amazon CloudWatch - 5 new 2 updated api methods

Changes  This release adds Create, Get, Update, and DeleteResourceMetricsConfiguration to enable detailed metric collection for an AWS resource, and adds UpdateOTelEnrichment plus include and exclude filters on StartOTelEnrichment so you can choose which metric namespaces CloudWatch enriches.

CreateResourceMetricsConfiguration (new) Link ¶

Creates a resource metrics configuration for an Amazon Web Services resource. After you create a configuration, Amazon CloudWatch collects detailed metrics for that resource.

Each Amazon Web Services resource can have only one resource metrics configuration. If a configuration already exists for the specified resource ARN, this operation returns a ConflictException. To modify an existing configuration, use UpdateResourceMetricsConfiguration.

If the Amazon Web Services resource that you specify in ResourceArn does not exist, this operation returns a ResourceNotFoundException. Verify that the resource ARN is correct and that the resource exists before you retry the request.

To create a resource metrics configuration, you must have the cloudwatch:CreateResourceMetricsConfiguration permission. For information about scoping this permission to specific resources, see Condition keys for resource metrics configuration access in the Amazon CloudWatch User Guide.

See also: AWS API Documentation

Request Syntax

client.create_resource_metrics_configuration(
    ResourceArn='string',
    MetricSelections=[
        {
            'IncludeMetrics': [
                'string',
            ]
        },
    ]
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Web Services resource to enable detailed monitoring for.

type MetricSelections:

list

param MetricSelections:

Specifies which metrics Amazon CloudWatch collects for the resource. If you omit this parameter, Amazon CloudWatch collects all available detailed metrics for the resource.

  • (dict) --

    Specifies which metrics Amazon CloudWatch collects for a resource metrics configuration. Include this in a CreateResourceMetricsConfiguration or UpdateResourceMetricsConfiguration request to limit collection to a specific set of metrics. If you omit metric selections, Amazon CloudWatch collects all available detailed metrics for the resource.

    • IncludeMetrics (list) -- [REQUIRED]

      The names of the metrics to collect for the resource. Amazon CloudWatch collects only the metrics that you list here.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ResourceMetricsConfiguration': {
        'ResourceArn': 'string',
        'CreatedAt': datetime(2015, 1, 1),
        'UpdatedAt': datetime(2015, 1, 1),
        'MetricSelections': [
            {
                'IncludeMetrics': [
                    'string',
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    Returns the newly created resource metrics configuration.

    • ResourceMetricsConfiguration (dict) --

      The resource metrics configuration that was created by this operation.

      • ResourceArn (string) --

        The Amazon Resource Name (ARN) of the Amazon Web Services resource that this configuration applies to.

      • CreatedAt (datetime) --

        The date and time that the resource metrics configuration was created.

      • UpdatedAt (datetime) --

        The date and time that the resource metrics configuration was last updated. When the configuration is first created, this value is the same as CreatedAt.

      • MetricSelections (list) --

        The metrics that Amazon CloudWatch collects for the resource. If this field is not present, Amazon CloudWatch collects all available detailed metrics for the resource.

        • (dict) --

          Specifies which metrics Amazon CloudWatch collects for a resource metrics configuration. Include this in a CreateResourceMetricsConfiguration or UpdateResourceMetricsConfiguration request to limit collection to a specific set of metrics. If you omit metric selections, Amazon CloudWatch collects all available detailed metrics for the resource.

          • IncludeMetrics (list) --

            The names of the metrics to collect for the resource. Amazon CloudWatch collects only the metrics that you list here.

            • (string) --

UpdateResourceMetricsConfiguration (new) Link ¶

Updates the resource metrics configuration for an Amazon Web Services resource. The MetricSelections value that you provide replaces any existing metric selections for the resource; it is not merged with them.

If you omit MetricSelections, Amazon CloudWatch removes any existing metric selection filter and collects all available detailed metrics for the resource.

This operation returns a ResourceNotFoundException if no resource metrics configuration exists for the specified resource ARN. To create a configuration, use CreateResourceMetricsConfiguration.

To update a resource metrics configuration, you must have the cloudwatch:UpdateResourceMetricsConfiguration permission. For information about scoping this permission to specific resources, see Condition keys for resource metrics configuration access in the Amazon CloudWatch User Guide.

See also: AWS API Documentation

Request Syntax

client.update_resource_metrics_configuration(
    ResourceArn='string',
    MetricSelections=[
        {
            'IncludeMetrics': [
                'string',
            ]
        },
    ]
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Web Services resource to update the resource metrics configuration for.

type MetricSelections:

list

param MetricSelections:

Specifies which metrics Amazon CloudWatch collects for the resource. The selections that you provide completely replace any existing metric selections.

If you omit this parameter, Amazon CloudWatch removes any existing metric selection filter and collects all available detailed metrics for the resource.

  • (dict) --

    Specifies which metrics Amazon CloudWatch collects for a resource metrics configuration. Include this in a CreateResourceMetricsConfiguration or UpdateResourceMetricsConfiguration request to limit collection to a specific set of metrics. If you omit metric selections, Amazon CloudWatch collects all available detailed metrics for the resource.

    • IncludeMetrics (list) -- [REQUIRED]

      The names of the metrics to collect for the resource. Amazon CloudWatch collects only the metrics that you list here.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ResourceMetricsConfiguration': {
        'ResourceArn': 'string',
        'CreatedAt': datetime(2015, 1, 1),
        'UpdatedAt': datetime(2015, 1, 1),
        'MetricSelections': [
            {
                'IncludeMetrics': [
                    'string',
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    Returns the updated resource metrics configuration.

    • ResourceMetricsConfiguration (dict) --

      The resource metrics configuration after the update was applied.

      • ResourceArn (string) --

        The Amazon Resource Name (ARN) of the Amazon Web Services resource that this configuration applies to.

      • CreatedAt (datetime) --

        The date and time that the resource metrics configuration was created.

      • UpdatedAt (datetime) --

        The date and time that the resource metrics configuration was last updated. When the configuration is first created, this value is the same as CreatedAt.

      • MetricSelections (list) --

        The metrics that Amazon CloudWatch collects for the resource. If this field is not present, Amazon CloudWatch collects all available detailed metrics for the resource.

        • (dict) --

          Specifies which metrics Amazon CloudWatch collects for a resource metrics configuration. Include this in a CreateResourceMetricsConfiguration or UpdateResourceMetricsConfiguration request to limit collection to a specific set of metrics. If you omit metric selections, Amazon CloudWatch collects all available detailed metrics for the resource.

          • IncludeMetrics (list) --

            The names of the metrics to collect for the resource. Amazon CloudWatch collects only the metrics that you list here.

            • (string) --

DeleteResourceMetricsConfiguration (new) Link ¶

Deletes the resource metrics configuration for an Amazon Web Services resource. After you delete the configuration, Amazon CloudWatch stops collecting detailed metrics for the resource. Metric data that Amazon CloudWatch already collected for the resource is not deleted.

This operation returns a ResourceNotFoundException if no resource metrics configuration exists for the specified resource ARN. Verify that the resource ARN is correct.

To delete a resource metrics configuration, you must have the cloudwatch:DeleteResourceMetricsConfiguration permission. For information about scoping this permission to specific resources, see Condition keys for resource metrics configuration access in the Amazon CloudWatch User Guide.

See also: AWS API Documentation

Request Syntax

client.delete_resource_metrics_configuration(
    ResourceArn='string'
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Web Services resource to delete the resource metrics configuration for.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

    No data is returned.

GetResourceMetricsConfiguration (new) Link ¶

Retrieves the current resource metrics configuration for an Amazon Web Services resource. The response includes the resource ARN, any metric selections, and the times at which the configuration was created and last updated.

This operation returns a ResourceNotFoundException if no resource metrics configuration exists for the specified resource ARN. To create a configuration, use CreateResourceMetricsConfiguration.

To retrieve a resource metrics configuration, you must have the cloudwatch:GetResourceMetricsConfiguration permission. For information about scoping this permission to specific resources, see Condition keys for resource metrics configuration access in the Amazon CloudWatch User Guide.

See also: AWS API Documentation

Request Syntax

client.get_resource_metrics_configuration(
    ResourceArn='string'
)
type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Web Services resource to retrieve the resource metrics configuration for.

rtype:

dict

returns:

Response Syntax

{
    'ResourceMetricsConfiguration': {
        'ResourceArn': 'string',
        'CreatedAt': datetime(2015, 1, 1),
        'UpdatedAt': datetime(2015, 1, 1),
        'MetricSelections': [
            {
                'IncludeMetrics': [
                    'string',
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    Returns the current resource metrics configuration for the specified resource.

    • ResourceMetricsConfiguration (dict) --

      The resource metrics configuration for the specified resource.

      • ResourceArn (string) --

        The Amazon Resource Name (ARN) of the Amazon Web Services resource that this configuration applies to.

      • CreatedAt (datetime) --

        The date and time that the resource metrics configuration was created.

      • UpdatedAt (datetime) --

        The date and time that the resource metrics configuration was last updated. When the configuration is first created, this value is the same as CreatedAt.

      • MetricSelections (list) --

        The metrics that Amazon CloudWatch collects for the resource. If this field is not present, Amazon CloudWatch collects all available detailed metrics for the resource.

        • (dict) --

          Specifies which metrics Amazon CloudWatch collects for a resource metrics configuration. Include this in a CreateResourceMetricsConfiguration or UpdateResourceMetricsConfiguration request to limit collection to a specific set of metrics. If you omit metric selections, Amazon CloudWatch collects all available detailed metrics for the resource.

          • IncludeMetrics (list) --

            The names of the metrics to collect for the resource. Amazon CloudWatch collects only the metrics that you list here.

            • (string) --

UpdateOTelEnrichment (new) Link ¶

Replaces the filters that determine which CloudWatch vended metrics are enriched with resource ARN and resource tag labels for the account. Enrichment must already be running for the account. If it is not, this operation returns a ResourceNotFoundException. To start enrichment, use StartOTelEnrichment.

The filters in the request completely replace the stored filters; they are not merged with them. IncludeFilters and ExcludeFilters are replaced as a pair, so a request that specifies only IncludeFilters also clears the stored ExcludeFilters, and a request that specifies neither clears both.

See also: AWS API Documentation

Request Syntax

client.update_o_tel_enrichment(
    IncludeFilters=[
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    ExcludeFilters=[
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ]
)
type IncludeFilters:

list

param IncludeFilters:

The metric namespaces, and the metric names, to enrich. If this parameter is omitted, every namespace that Amazon CloudWatch supports for enrichment is in scope.

A maximum of 100 filters is allowed across IncludeFilters and ExcludeFilters combined.

  • (dict) --

    Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

    A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

    • Namespace (string) -- [REQUIRED]

      The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

    • MetricNames (list) --

      The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

      A maximum of 100 metric names is allowed for each selector.

      • (string) --

type ExcludeFilters:

list

param ExcludeFilters:

The metric namespaces, and the metric names, to leave unenriched. If this parameter is omitted, nothing is excluded.

Amazon CloudWatch applies ExcludeFilters after IncludeFilters, so a metric that both parameters match is not enriched.

A maximum of 100 filters is allowed across IncludeFilters and ExcludeFilters combined.

  • (dict) --

    Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

    A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

    • Namespace (string) -- [REQUIRED]

      The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

    • MetricNames (list) --

      The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

      A maximum of 100 metric names is allowed for each selector.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'IncludeFilters': [
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    'ExcludeFilters': [
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • IncludeFilters (list) --

      The include filters that are stored for the account after the replacement. This parameter is omitted when the request cleared the include filters, which means that every supported namespace is in scope.

      • (dict) --

        Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

        A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

        • Namespace (string) --

          The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

        • MetricNames (list) --

          The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

          A maximum of 100 metric names is allowed for each selector.

          • (string) --

    • ExcludeFilters (list) --

      The exclude filters that are stored for the account after the replacement. This parameter is omitted when the request cleared the exclude filters, which means that nothing is excluded.

      • (dict) --

        Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

        A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

        • Namespace (string) --

          The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

        • MetricNames (list) --

          The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

          A maximum of 100 metric names is allowed for each selector.

          • (string) --

    • CreatedAt (datetime) --

      The date and time that enrichment started for the account.

    • UpdatedAt (datetime) --

      The date and time that the enrichment configuration for the account was last stored.

GetOTelEnrichment (updated) Link ¶
Changes (response)
{'CreatedAt': 'timestamp',
 'ExcludeFilters': [{'MetricNames': ['string'], 'Namespace': 'string'}],
 'IncludeFilters': [{'MetricNames': ['string'], 'Namespace': 'string'}],
 'UpdatedAt': 'timestamp'}

Returns the current status of vended metric enrichment for the account, including whether CloudWatch vended metrics are enriched with resource ARN and resource tag labels and queryable using PromQL. For the list of supported resources, see Supported Amazon Web Services infrastructure metrics.

See also: AWS API Documentation

Request Syntax

client.get_o_tel_enrichment()
rtype:

dict

returns:

Response Syntax

{
    'Status': 'Running'|'Stopped',
    'IncludeFilters': [
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    'ExcludeFilters': [
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • Status (string) --

      The status of OTel enrichment for the account. Valid values are Running (enrichment is enabled) and Stopped (enrichment is disabled).

    • IncludeFilters (list) --

      The metric namespaces, and the metric names, that are enriched. This parameter is omitted when enrichment is stopped, and when enrichment is running with no include filters, which means that every supported namespace is in scope.

      • (dict) --

        Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

        A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

        • Namespace (string) --

          The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

        • MetricNames (list) --

          The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

          A maximum of 100 metric names is allowed for each selector.

          • (string) --

    • ExcludeFilters (list) --

      The metric namespaces, and the metric names, that are left unenriched. This parameter is omitted when enrichment is stopped, and when enrichment is running with no exclude filters, which means that nothing is excluded.

      • (dict) --

        Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

        A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

        • Namespace (string) --

          The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

        • MetricNames (list) --

          The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

          A maximum of 100 metric names is allowed for each selector.

          • (string) --

    • CreatedAt (datetime) --

      The date and time that enrichment started for the account. This parameter is omitted when enrichment is stopped.

    • UpdatedAt (datetime) --

      The date and time that the enrichment configuration for the account was last stored.

StartOTelEnrichment (updated) Link ¶
Changes (request, response)
Request
{'ExcludeFilters': [{'MetricNames': ['string'], 'Namespace': 'string'}],
 'IncludeFilters': [{'MetricNames': ['string'], 'Namespace': 'string'}]}
Response
{'CreatedAt': 'timestamp',
 'ExcludeFilters': [{'MetricNames': ['string'], 'Namespace': 'string'}],
 'IncludeFilters': [{'MetricNames': ['string'], 'Namespace': 'string'}],
 'UpdatedAt': 'timestamp'}

Enables enrichment and PromQL access for CloudWatch vended metrics for supported Amazon Web Services resources in the account. Once enabled, metrics that contain a resource identifier dimension (for example, EC2 CPUUtilization with an InstanceId dimension) are enriched with resource ARN and resource tag labels and become queryable using PromQL.

Before calling this operation, you must enable resource tags on telemetry for your account. For more information, see Enable resource tags on telemetry.

Optionally, IncludeFilters and ExcludeFilters limit enrichment to a subset of the account's metrics. These filters are stored only when this operation starts enrichment. Calling StartOTelEnrichment for an account where enrichment is already running has no effect and does not modify the filters that are applied. To change them, use UpdateOTelEnrichment.

See also: AWS API Documentation

Request Syntax

client.start_o_tel_enrichment(
    IncludeFilters=[
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    ExcludeFilters=[
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ]
)
type IncludeFilters:

list

param IncludeFilters:

The metric namespaces, and the metric names, to enrich. If this parameter is omitted, every namespace that Amazon CloudWatch supports for enrichment is in scope.

A maximum of 100 filters is allowed across IncludeFilters and ExcludeFilters combined.

  • (dict) --

    Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

    A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

    • Namespace (string) -- [REQUIRED]

      The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

    • MetricNames (list) --

      The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

      A maximum of 100 metric names is allowed for each selector.

      • (string) --

type ExcludeFilters:

list

param ExcludeFilters:

The metric namespaces, and the metric names, to leave unenriched. If this parameter is omitted, nothing is excluded.

Amazon CloudWatch applies ExcludeFilters after IncludeFilters, so a metric that both parameters match is not enriched.

A maximum of 100 filters is allowed across IncludeFilters and ExcludeFilters combined.

  • (dict) --

    Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

    A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

    • Namespace (string) -- [REQUIRED]

      The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

    • MetricNames (list) --

      The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

      A maximum of 100 metric names is allowed for each selector.

      • (string) --

rtype:

dict

returns:

Response Syntax

{
    'IncludeFilters': [
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    'ExcludeFilters': [
        {
            'Namespace': 'string',
            'MetricNames': [
                'string',
            ]
        },
    ],
    'CreatedAt': datetime(2015, 1, 1),
    'UpdatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • IncludeFilters (list) --

      The include filters that are stored for the account.

      • (dict) --

        Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

        A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

        • Namespace (string) --

          The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

        • MetricNames (list) --

          The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

          A maximum of 100 metric names is allowed for each selector.

          • (string) --

    • ExcludeFilters (list) --

      The exclude filters that are stored for the account.

      • (dict) --

        Selects the metrics in one namespace, for use in the IncludeFilters or ExcludeFilters parameter of StartOTelEnrichment or UpdateOTelEnrichment.

        A maximum of 100 selectors is allowed across IncludeFilters and ExcludeFilters combined.

        • Namespace (string) --

          The namespace of the metrics to select. Namespaces are matched exactly and are case-sensitive.

        • MetricNames (list) --

          The names of the metrics to select within the namespace. Metric names are matched exactly and are case-sensitive. If this parameter is omitted, every metric in the namespace is selected.

          A maximum of 100 metric names is allowed for each selector.

          • (string) --

    • CreatedAt (datetime) --

      The date and time that enrichment started for the account.

    • UpdatedAt (datetime) --

      The date and time that the enrichment configuration for the account was last stored.