-
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.
validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java
Outdated
Show resolved
Hide resolved
...rc/main/resources/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache
Show resolved
Hide resolved
...rc/main/resources/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache
Show resolved
Hide resolved
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
…her/aws-application-signals-test-framework into otel-custom-metrics-test
This reverts commit 3359c0b.
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.
Seems like the custom_metrics_enabled
flag is irrelevant and the feature is independent from the default behaviour. We should just generalize the test and include this validation into the test by default.
sample-apps/python/django_frontend_service/frontend_service_app/views.py
Show resolved
Hide resolved
.../resources/expected-data-template/python/ec2/custom-metrics/aws-otel-custom-metrics.mustache
Outdated
Show resolved
Hide resolved
.../resources/expected-data-template/python/ec2/custom-metrics/aws-otel-custom-metrics.mustache
Outdated
Show resolved
Hide resolved
.../resources/expected-data-template/python/ec2/custom-metrics/aws-otel-custom-metrics.mustache
Outdated
Show resolved
Hide resolved
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \ | ||
|| deployment_failed=$? | ||
|| deployment_failed=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.
Undo this
export OTEL_EXPORTER_OTLP_INSECURE=true | ||
export OTEL_SERVICE_NAME=python-sample-application-${var.test_id} | ||
export OTEL_TRACES_SAMPLER=always_on | ||
export OTEL_RESOURCE_ATTRIBUTES="Service=python-sample-application-${var.test_id},Environment=ec2:default" |
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.
Remove this line
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.
Seems like the changes to this file don't do anything functionally different then before, is that correct?
If so, should probably not change it at all
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
Test 3
Test 4
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.