aws / aws/amazon-cloudwatch-agent

Set sampling rate in CloudWatch agent

Open
#1,015 2 comments 0 reactions 0 assignees View on GitHub
status/backlog status/proposed
Dominant language
Go
Stars
550
Forks
271
Avg merge
1d 21h
Merged PRs (30d)
13

Description

**Is your feature request related to a problem? Please describe.**
A way to set sampling_rate in CloudWatch agent.

[Previous feture_request](https://github.com/aws/amazon-cloudwatch-agent/issues/257) was closed. It was suggested to implement sampling in application_code and leverage the added [filters](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Logssection) to mimic sampling logs.

**Describe the solution you'd like**
First-class support of setting sampling_rate as part of the [agent config file](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.html#CloudWatch-Agent-Configuration-File-Complete-Example)

**Describe alternatives you've considered**
Implementing sampling in application_code by flagging sampled/unsampled logs; then instruct CWAgent to only include sampled log_lines via the filters configuration.

**Additional context**
Support setting sampling rate is a common feature in log_systems. E.g. [Sentry](https://docs.sentry.io/platforms/java/guides/log4j2/configuration/sampling/)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the agent configuration file details and the existing filters configuration described in the issue. Compare the proposed first-class sampling_rate setting with the suggested application-side sampling approach. Done means the agent can accept and apply a sampling rate through its configuration, with the relevant behavior verified by project tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.