-
Notifications
You must be signed in to change notification settings - Fork 23
[Python] Custom Metrics E2E Test #471
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
base: main
Are you sure you want to change the base?
[Python] Custom Metrics E2E Test #471
Conversation
…ervability/aws-application-signals-test-framework into otel-custom-metrics-test
…ervability/aws-application-signals-test-framework into otel-custom-metrics-test
This reverts commit 72c88c5.
This reverts commit e2e01a8.
|
||
env: | ||
E2E_TEST_AWS_REGION: 'us-west-2' | ||
E2E_TEST_AWS_REGION: 'us-east-1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change stuff for unrelated files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
|
||
env: | ||
E2E_TEST_AWS_REGION: us-west-2 | ||
E2E_TEST_AWS_REGION: us-east-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
|
||
env: | ||
E2E_TEST_AWS_REGION: 'us-west-2' # Test uses us-west-2 in the us-east-1 accoun | ||
E2E_TEST_AWS_REGION: 'us-east-1' # Test uses us-east-1 in the us-east-1 account |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
|
||
env: | ||
E2E_TEST_AWS_REGION: 'us-west-2' | ||
E2E_TEST_AWS_REGION: 'us-east-1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
|
||
env: | ||
E2E_TEST_AWS_REGION: 'us-west-2' | ||
E2E_TEST_AWS_REGION: 'us-east-1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
# Copy in CW Agent configuration | ||
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}' | ||
echo $agent_config > amazon-cloudwatch-agent.json | ||
echo "$agent_config" > amazon-cloudwatch-agent.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agent_config goes through the replace function and the quotes are just to prevent word splitting from breaking it.
/** Python EC2 Default Custom Metrics Test Case Validations */ | ||
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Python EC2 Default Custom Metrics Test Case Validations */ | |
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"), | |
/** Python EC2 Default Custom Metrics Test Case Validations */ | |
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be moved to .../python/ec2/custom-metrics
since it's a unique test case, even though it's using the same workflow file. Same with the other file added under .../resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
value: {{serviceName}} | ||
- | ||
name: cloud.account.id | ||
value: ANY_VALUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We know the values in some cases, so we should put it in. In this case, we know the account ID so we should be able to validate it fully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
value: opentelemetry | ||
- | ||
name: telemetry.sdk.version | ||
value: 1.33.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value can change in the future, don't hardcode it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be updated in the next push
This PR adds custom metrics to the existing sample app to verify public documentation is correct and functionality continues to work as changes happen in the future (Regression testing). Specifically for OpenTelemetry metrics using the CloudWatch Agent.
The changes made in this PR are:
IMPORTANT
Updates to views.py effect 'python-sample-app.zip which exists in S3 bucket. Proper Zip protocol must be followed for it properly deploy and run. If not it will fail.
Rollback procedure:
A git revert to the most recent SHA (4ca5d60) will be easy to revert back to if necessary.
Passing test runs:
Test 1
Test 2
References:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AppSignals-CustomMetrics.html#AppSignals-CustomMetrics-OpenTelemetry
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-OpenTelemetry-metrics.html
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exporter-selection
https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_metrics_endpoint
https://opentelemetry.io/docs/specs/otel/metrics/sdk/
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.