Skip to content

Add support for metric filtering (e.g., namepass / namedrop) for StatsD listener in CloudWatch Agent #1933

@kammireddy

Description

@kammireddy

Is your feature request related to a problem? Please describe.
The CloudWatch Agent’s StatsD listener currently forwards all received metrics to CloudWatch without any option to filter them. I only want to publish specific metrics, but there’s no built-in way to include or exclude metrics based on their names or patterns.

In our environment, multiple StatsD listeners consume the same metrics (including the CloudWatch Agent). Updating all application StatsD clients to support multiple destinations and apply filtering rules specific to each destination is not a viable solution.

Describe the solution you'd like
I would like the CloudWatch Agent to support metric filtering for StatsD metrics, similar to Telegraf’s metric filtering.

At a minimum, support for namepass (include list) and optionally namedrop (exclude list) would be very useful.

Example configuration:

"statsd": {
    "service_address": ":8125",
    "metrics_collection_interval": 60,
    "metric_filter": {
        "namepass": ["app.requests.*", "app.latency.mean"]
    }
}

This would allow publishing only the desired metrics to CloudWatch.

Describe alternatives you've considered
Filtering in the application layer: Updating all StatsD clients across multiple applications to handle filtering and multiple destinations is not viable.

Additional context
This feature would allow more precise control over metric publication and avoid sending unnecessary data to CloudWatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions