Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource metric integration test #453

Merged
merged 69 commits into from
Jan 28, 2025
Merged

Conversation

varunch77
Copy link
Member

@varunch77 varunch77 commented Jan 17, 2025

Description of the issue

There is no integration test that verifies that an entity is being sent when we send resource metrics such as cpu and memory to CloudWatch—this is currently a gap in our testing.

Description of changes

  • Create an agent config to send resource metrics to Cloudwatch
  • Sign and send a request that calls ListEntitiesForMetric to get the entity associated with our metrics
  • Validate the returned entity
  • Update our integration testing IAM role to include permission for ListEntitiesForMetric

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

Integration test run: https://github.com/aws/amazon-cloudwatch-agent/actions/runs/12838570212

@varunch77
Copy link
Member Author

Changes:

  • Removed anything logs-related
  • Moved the location of the test into the entity folder
  • Created a helper function in the util/common/metrics package to handle building the ListEntitiesForMetric call
  • Updated the entity validation to use existing helper functions

test/entity/entity_test.go Outdated Show resolved Hide resolved
@zhihonl
Copy link
Contributor

zhihonl commented Jan 24, 2025

Can you attach a new integration test run with this change so we can make sure the test still passes?

@varunch77
Copy link
Member Author

varunch77 commented Jan 27, 2025

lisguo
lisguo previously approved these changes Jan 27, 2025
zhihonl
zhihonl previously approved these changes Jan 27, 2025
@varunch77 varunch77 dismissed stale reviews from zhihonl and lisguo via ff409b4 January 27, 2025 21:02
@varunch77 varunch77 merged commit 9c7f0db into main Jan 28, 2025
2 checks passed
@varunch77 varunch77 deleted the resource-metric-integ-test branch January 28, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants