Skip to content

Conversation

Paamicky
Copy link
Contributor

@Paamicky Paamicky commented Jul 21, 2025

Description of the issue

Currently, there is no way to know the number of customers using the windows event filtering in the Agent's configuration. This PR address this issue by adding the feature as part of the user-agent string for detection during API calls to CloudWatch.

NOTE: This PR is on hold for updates on Agent Health Metrics

Description of changes

  • Detection logic for when a particular filter is used in the agent json configuration file.
  • Filter flag is added to the user-agent input string and recorded during API calls to CloudWatch.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Filter flags been added to the user-agent input string.

POST / HTTP/1.1
Host: logs.us-east-2.amazonaws.com
User-Agent: CWAgent/1.300056.1-7-g037fe7f6-untracked (go1.24.4; windows; amd64) ID/ad6e9ec7-f161-494a-87ba-b546b420dadd inputs:(nop run_as_user windows_event_filters windows_event_ids windows_event_levels windows_event_log) outputs:(cloudwatchlogs nop) aws-sdk-go/1.48.6 (go1.24.4; windows; amd64) exec-env/EC2
Content-Length: 251
Authorization: AWS4-HMAC-SHA256 Credential=ASIAS3VO6ZR4K5ECXB6Q/20250721/us-east-2/logs/aws4_request, SignedHeaders=content-encoding;content-length;content-type;host;x-amz-agent-stats;x-amz-date;x-amz-security-token;x-amz-target, Signature=eadcd0c0c03140c8083dc4089b4abe41090bc11fd29a120b212fc222dd3438de
Content-Encoding: gzip
Content-Type: application/x-amz-json-1.1
X-Amz-Agent-Stats: "cpu":17.8,"mem":61575168,"th":15,"ric":0,"rt":"EC2M","m":"EC2"
X-Amz-Date: 20250721T135521Z
X-Amz-Target: Logs_20140328.PutLogEvents
Accept-Encoding: gzip�

Dashboard showing usage of filters: Team Dashboard

Requirements

Before commiting your code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

Integration Tests

To run integration tests against this PR, add the ready for testing label.

@Paamicky Paamicky force-pushed the feature/windows-regex-filtering branch from 27765e3 to 615200a Compare July 21, 2025 22:11
@Paamicky Paamicky force-pushed the feature/windows-regex-filtering branch from 615200a to 9fb255f Compare July 22, 2025 16:18
@okankoAMZ okankoAMZ marked this pull request as ready for review July 22, 2025 21:09
@okankoAMZ okankoAMZ requested a review from a team as a code owner July 22, 2025 21:09
@Paamicky Paamicky force-pushed the AdoptionMetric-windows-event-filters branch from 17a0312 to 874edae Compare July 23, 2025 17:45
okankoAMZ
okankoAMZ previously approved these changes Jul 23, 2025
Base automatically changed from feature/windows-regex-filtering to main July 23, 2025 18:08
@Paamicky Paamicky dismissed okankoAMZ’s stale review July 23, 2025 18:08

The base branch was changed.

@Paamicky Paamicky added the ready for testing Indicates this PR is ready for integration tests to run label Jul 23, 2025
Copy link
Contributor

This PR was marked stale due to lack of activity.

@github-actions github-actions bot added the Stale label Jul 31, 2025
@github-actions github-actions bot removed the Stale label Aug 28, 2025
Copy link
Contributor

github-actions bot commented Sep 6, 2025

This PR was marked stale due to lack of activity.

@github-actions github-actions bot added the Stale label Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for testing Indicates this PR is ready for integration tests to run Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants