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 integ test for Amazon Managed Prometheus as destination #414

Merged
merged 6 commits into from
Jul 30, 2024

Conversation

movence
Copy link
Contributor

@movence movence commented Jul 26, 2024

Depends on aws/amazon-cloudwatch-agent#1192

Description of changes

Add integ test for Amazon Managed Prometheus as destination.

New AMP integ test:

  • Uses existing linux terraform to set up an ec2 stack which also creates AMP workspace when test/amp is used
  • Uses CPU and Process plugins to emit and validate metrics
  • validates metrics with append_dimensions (both metric and global level), rename and aggregation_dimensions

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

Test run:

null_resource.integration_test_run (remote-exec): This is the aws region:  us-west-2
null_resource.integration_test_run (remote-exec): === RUN   TestAmp
null_resource.integration_test_run (remote-exec): 2024/07/25 20:54:46 Running AMPTest
...
null_resource.integration_test_run (remote-exec): 2024/07/25 20:55:50 The average value 0.333333 for metric processes_zombies are within bound [0.000000, 0.000000]
null_resource.integration_test_run (remote-exec): --- PASS: TestAmp (64.29s)
null_resource.integration_test_run (remote-exec): PASS
null_resource.integration_test_run (remote-exec): ok  	github.com/aws/amazon-cloudwatch-agent-test/test/amp	64.314s
null_resource.integration_test_run: Creation complete after 10m6s [id=6863983178346704537]

@movence movence requested a review from a team as a code owner July 26, 2024 01:50
"*"
],
"drop_original_metrics": [
"usage_iowait",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to drop these two metrics?

Paramadon
Paramadon previously approved these changes Jul 29, 2024
Copy link
Contributor

@Paramadon Paramadon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@okankoAMZ okankoAMZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only comment is can we make the test name bit more descriptive than AmpTest . It feels like it will be hard to distinguish in the long run

Copy link
Contributor

@okankoAMZ okankoAMZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

const (
namespace = "AMPDestinationTest"
// template prometheus query for getting average of 3 min
ampQueryTemplate = "avg_over_time(%s%s[3m])"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@movence movence merged commit 30b4eb1 into aws:main Jul 30, 2024
2 checks passed
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