Skip to content

Commit e1717f1

Browse files
committed
testing 2nd round pr updates
1 parent a2c4041 commit e1717f1

File tree

9 files changed

+49
-29
lines changed

9 files changed

+49
-29
lines changed

.github/workflows/python-ec2-default-test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ env:
5454
ADOT_WHEEL_NAME: ${{ inputs.staging-wheel-name }}
5555
OTEL_SOURCE: ${{ inputs.otel-source }}
5656
CUSTOM_METRICS_ENABLED: ${{ inputs.custom-metrics-enabled }}
57-
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/python-sample-app.zip
57+
SAMPLE_APP_ZIP: s3://aws-appsignals-sample-app-prod-${{ inputs.aws-region }}/python-sample-app-delete-me.zip
5858
E2E_TEST_ACCOUNT_ID: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ACCOUNT_ID }}
5959
E2E_TEST_ROLE_NAME: ${{ secrets.APPLICATION_SIGNALS_E2E_TEST_ROLE_NAME }}
6060
METRIC_NAMESPACE: ApplicationSignals
@@ -176,7 +176,6 @@ jobs:
176176
-var="get_adot_wheel_command=${{ env.GET_ADOT_WHEEL_COMMAND }}" \
177177
-var="language_version=${{ env.PYTHON_VERSION }}" \
178178
-var="cpu_architecture=${{ env.CPU_ARCHITECTURE }}" \
179-
-var="custom_metrics_enabled=${{ env.CUSTOM_METRICS_ENABLED }}" \
180179
|| deployment_failed=1
181180
if [ $deployment_failed -eq 1 ]; then
182181
echo "Terraform deployment was unsuccessful. Will attempt to retry deployment."
@@ -259,8 +258,8 @@ jobs:
259258

260259
- name: Validate CWAgent metrics
261260
id: cwagent-metric-validation
262-
if: (success() || (env.CUSTOM_METRICS_ENABLED == 'true' && steps.log-validation.outcome == 'failure')) && !cancelled()
263-
run: ./gradlew validator:run --args='-c python/ec2/custom-metrics/custom-metric-validation.yml
261+
if: (success() || ( steps.log-validation.outcome == 'failure') && !cancelled()
262+
run: ./gradlew validator:run --args='-c python/ec2/default/custom-metric-validation.yml
264263
--testing-id ${{ env.TESTING_ID }}
265264
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
266265
--remote-service-deployment-name ${{ env.REMOTE_SERVICE_IP }}:8001
@@ -276,7 +275,7 @@ jobs:
276275

277276
- name: Validate generated traces
278277
id: trace-validation
279-
if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure' || (env.CUSTOM_METRICS_ENABLED == 'true' && steps.cwagent-metric-validation.outcome == 'failure')) && !cancelled()
278+
if: (success() || steps.log-validation.outcome == 'failure' || steps.metric-validation.outcome == 'failure' || (steps.cwagent-metric-validation.outcome == 'failure') && !cancelled()
280279
run: ./gradlew validator:run --args='-c python/ec2/default/trace-validation.yml
281280
--testing-id ${{ env.TESTING_ID }}
282281
--endpoint http://${{ env.MAIN_SERVICE_ENDPOINT }}
@@ -303,7 +302,7 @@ jobs:
303302
if: always()
304303
id: validation-result
305304
run: |
306-
if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ env.CUSTOM_METRICS_ENABLED }}" = "true" ] && [ "${{ steps.cwagent-metric-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
305+
if [ "${{ steps.log-validation.outcome }}" = "success" ] && [ "${{ steps.cwagent-metric-validation.outcome }}" = "success" ] && [ "${{ steps.metric-validation.outcome }}" = "success" ] && [ "${{ steps.trace-validation.outcome }}" = "success" ]; then
307306
echo "validation-result=success" >> $GITHUB_OUTPUT
308307
else
309308
echo "validation-result=failure" >> $GITHUB_OUTPUT

.github/workflows/python-sample-app-s3-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848

4949
- name: Build Sample App Zip
5050
working-directory: sample-apps/python
51-
run: zip -r python-sample-app.zip .
51+
run: zip -r python-sample-app-delete-me.zip .
5252

5353
- name: Upload to S3
5454
working-directory: sample-apps/python
55-
run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./python-sample-app.zip --key python-sample-app.zip
55+
run: aws s3api put-object --bucket ${{ secrets.APP_SIGNALS_E2E_EC2_JAR }}-prod-${{ matrix.aws-region }} --body ./python-sample-app-delete-me.zip --key python-sample-app-delete-me.zip
5656

5757
- name: Build Gen AI Sample App Zip
5858
working-directory: sample-apps/python/genai_service

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
## SPDX-License-Identifier: Apache-2.0
3+
4+
# This is a reusable workflow for running the Enablement test for App Signals.
5+
# It is meant to be called from another workflow.
6+
# Read more about reusable workflows: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
7+
name: Test
8+
on:
9+
push:
10+
branches:
11+
- otel-custom-metrics-test
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
jobs:
18+
java-ec2-default:
19+
uses: ./.github/workflows/python-ec2-default-test.yml
20+
secrets: inherit
21+
with:
22+
caller-workflow-name: 'test'
23+
aws-region: 'us-east-1'
24+
25+
custom-metrics:
26+
uses: ./.github/workflows/python-ec2-default-test.yml
27+
secrets: inherit
28+
with:
29+
caller-workflow-name: 'test'
30+
aws-region: 'us-east-1'

terraform/python/ec2/adot-genai/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# -------------------------------------------------------------------------
1515

1616
variable "aws_region" {
17-
default = "us-east-1"
17+
default = "us-west-2"
1818
}
1919

2020
variable "test_id" {

terraform/python/ec2/default/main.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ resource "null_resource" "main_service_setup" {
161161
${var.get_adot_wheel_command}
162162
163163
# Get and run the sample application with configuration
164-
aws s3 cp ${var.sample_app_zip} ./python-sample-app.zip
165-
unzip -o python-sample-app.zip
164+
aws s3 cp ${var.sample_app_zip} ./python-sample-app-delete-me.zip
165+
unzip -o python-sample-app-delete-me.zip
166166
167167
# Export environment variables for instrumentation
168168
cd ./django_frontend_service
@@ -183,7 +183,6 @@ resource "null_resource" "main_service_setup" {
183183
export OTEL_TRACES_SAMPLER=always_on
184184
export OTEL_RESOURCE_ATTRIBUTES="Service=python-sample-application-${var.test_id},Environment=ec2:default"
185185
export AWS_REGION='${var.aws_region}'
186-
export CUSTOM_METRICS_ENABLED='${var.custom_metrics_enabled}'
187186
python${var.language_version} manage.py migrate
188187
nohup opentelemetry-instrument python${var.language_version} manage.py runserver 0.0.0.0:8000 --noreload &
189188
@@ -296,8 +295,8 @@ resource "null_resource" "remote_service_setup" {
296295
${var.get_adot_wheel_command}
297296
298297
# Get and run the sample application with configuration
299-
aws s3 cp ${var.sample_app_zip} ./python-sample-app.zip
300-
unzip -o python-sample-app.zip
298+
aws s3 cp ${var.sample_app_zip} ./python-sample-app-delete-me.zip
299+
unzip -o python-sample-app-delete-me.zip
301300
302301
# Export environment variables for instrumentation
303302
cd ./django_remote_service

terraform/python/ec2/default/variables.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,4 @@ variable "language_version" {
4747

4848
variable "cpu_architecture" {
4949
default = "x86_64"
50-
}
51-
52-
#Adding Custom Metrics Variables
53-
54-
variable "custom_metrics_enabled" {
55-
description = "Enable custom OTEL metrics in the sample application"
56-
type = bool
57-
default = false
5850
}

validator/src/main/java/com/amazon/aoc/fileconfigs/PredefinedExpectedTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public enum PredefinedExpectedTemplate implements FileConfig {
211211
PYTHON_EC2_DEFAULT_CLIENT_CALL_TRACE("/expected-data-template/python/ec2/default/client-call-trace.mustache"),
212212

213213
/** Python EC2 Default Custom Metrics Test Case Validations */
214-
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/custom-metrics/aws-otel-custom-metrics.mustache"),
214+
PYTHON_EC2_DEFAULT_AWS_OTEL_CUSTOM_METRIC("/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache"),
215215

216216
/** Python EC2 Asg Test Case Validations */
217217
PYTHON_EC2_ASG_OUTGOING_HTTP_CALL_LOG("/expected-data-template/python/ec2/asg/outgoing-http-call-log.mustache"),

validator/src/main/resources/expected-data-template/python/ec2/custom-metrics/aws-otel-custom-metrics.mustache renamed to validator/src/main/resources/expected-data-template/python/ec2/default/aws-otel-custom-metrics.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
value: {{serviceName}}
1616
-
1717
name: cloud.account.id
18-
value: 654654176582
18+
value: ANY_VALUE
1919
-
2020
name: cloud.availability_zone
2121
value: ANY_VALUE
@@ -27,7 +27,7 @@
2727
value: aws
2828
-
2929
name: cloud.region
30-
value: us-east-1
30+
value: {{AWS_REGION}}
3131
-
3232
name: host.id
3333
value: ANY_VALUE
@@ -36,7 +36,7 @@
3636
value: ANY_VALUE
3737
-
3838
name: host.type
39-
value: t3.micro
39+
value: ANY_VALUE
4040
-
4141
name: operation.type
4242
value: custom_export_1
@@ -70,7 +70,7 @@
7070
value: {{serviceName}}
7171
-
7272
name: cloud.account.id
73-
value: 654654176582
73+
value: ANY_VALUE
7474
-
7575
name: cloud.availability_zone
7676
value: ANY_VALUE
@@ -82,7 +82,7 @@
8282
value: aws
8383
-
8484
name: cloud.region
85-
value: us-east-1
85+
value: {{AWS_REGION}}
8686
-
8787
name: host.id
8888
value: ANY_VALUE
@@ -91,7 +91,7 @@
9191
value: ANY_VALUE
9292
-
9393
name: host.type
94-
value: t3.micro
94+
value: ANY_VALUE
9595
-
9696
name: operation.type
9797
value: histogram

validator/src/main/resources/validations/python/ec2/custom-metrics/custom-metric-validation.yml renamed to validator/src/main/resources/validations/python/ec2/default/custom-metric-validation.yml

File renamed without changes.

0 commit comments

Comments
 (0)