Skip to content

Commit 493353a

Browse files
bjraraharrryr
andauthored
Enable runtime metrics in canaries (#326)
*Description of changes:* 1. Enable runtime metrics in existing Python and Java canaries. 2. Upgrade ECR image to use G1GC as default GC. 3. Use `Always` ImagePullPolicy for k8s workloads. *Rollback procedure:* <Can we safely revert this commit if needed? If not, detail what must be done to safely revert and why it is needed.> *Ensure you've run the following tests on your changes and include the link below:* ECR https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11967144237 Python eks https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11963840109 Python ec2 https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11963729958 Python ecs https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11963731839 Python k8s https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11963859634 Java eks https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11977537794 Java ec2 https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11964002141 Java ecs https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11967188838 Java k8s https://github.com/aws-observability/aws-application-signals-test-framework/actions/runs/11967448835 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: Harry <[email protected]>
1 parent ab5e4f3 commit 493353a

35 files changed

+113
-64
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ jobs:
112112
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
113113
echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" >> $GITHUB_ENV
114114
elif [ "${{ env.OTEL_SOURCE }}" == "maven" ]; then
115-
echo "Latest version for Maven is: 1.32.4"
116-
echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://repo1.maven.org/maven2/software/amazon/opentelemetry/aws-opentelemetry-agent/1.32.4/aws-opentelemetry-agent-1.32.4.jar" >> $GITHUB_ENV
115+
echo "Latest version for Maven is: 1.32.5"
116+
echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://repo1.maven.org/maven2/software/amazon/opentelemetry/aws-opentelemetry-agent/1.32.5/aws-opentelemetry-agent-1.32.5.jar" >> $GITHUB_ENV
117117
else
118118
echo GET_ADOT_JAR_COMMAND="wget -O adot.jar https://github.com/aws-observability/aws-otel-java-instrumentation/releases/latest/download/aws-opentelemetry-agent.jar" >> $GITHUB_ENV
119119
fi

sample-apps/java/springboot-main-service/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jib {
6161
}
6262
container {
6363
mainClass = "com.amazon.sampleapp.FrontendService"
64+
jvmFlags = listOf("-XX:+UseG1GC")
6465
ports = listOf("8080")
6566
}
6667
}

sample-apps/java/springboot-remote-service/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jib {
5656
}
5757
container {
5858
mainClass = "com.amazon.sampleapp.RemoteService"
59+
jvmFlags = listOf("-XX:+UseG1GC")
5960
ports = listOf("8080")
6061
}
6162
}

terraform/java/ec2/asg/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ resource "aws_launch_configuration" "launch_configuration" {
109109
sudo yum install java-${var.language_version}-amazon-corretto -y
110110
fi
111111
112+
# enable ec2 instance connect for debug
113+
sudo yum install ec2-instance-connect -y
114+
112115
# Copy in CW Agent configuration
113116
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
114117
echo $agent_config > amazon-cloudwatch-agent.json
@@ -128,12 +131,11 @@ resource "aws_launch_configuration" "launch_configuration" {
128131
OTEL_METRICS_EXPORTER=none \
129132
OTEL_LOGS_EXPORT=none \
130133
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
131-
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
132134
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
133135
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
134136
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
135137
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${var.test_id} \
136-
nohup java -jar main-service.jar &> nohup.out &
138+
nohup java -jar -XX:+UseG1GC main-service.jar &> nohup.out &
137139
138140
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
139141
sleep 30
@@ -230,12 +232,11 @@ resource "null_resource" "remote_service_setup" {
230232
OTEL_METRICS_EXPORTER=none \
231233
OTEL_LOGS_EXPORT=none \
232234
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
233-
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
234235
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
235236
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
236237
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
237238
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${var.test_id} \
238-
nohup java -jar remote-service.jar &> nohup.out &
239+
nohup java -XX:+UseG1GC -jar remote-service.jar &> nohup.out &
239240
240241
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
241242
sleep 30

terraform/java/ec2/default/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ resource "null_resource" "main_service_setup" {
141141
OTEL_METRICS_EXPORTER=none \
142142
OTEL_LOGS_EXPORT=none \
143143
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
144-
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
145144
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
146145
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
147146
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
148147
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${var.test_id} \
149-
nohup java -jar main-service.jar &> nohup.out &
148+
nohup java -XX:+UseG1GC -jar main-service.jar &> nohup.out &
150149
151150
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
152151
sleep 30
@@ -217,6 +216,9 @@ resource "null_resource" "remote_service_setup" {
217216
sudo yum install java-${var.language_version}-amazon-corretto -y
218217
fi
219218
219+
# enable ec2 instance connect for debug
220+
sudo yum install ec2-instance-connect -y
221+
220222
# Copy in CW Agent configuration
221223
agent_config='${replace(replace(file("./amazon-cloudwatch-agent.json"), "/\\s+/", ""), "$REGION", var.aws_region)}'
222224
echo $agent_config > amazon-cloudwatch-agent.json
@@ -236,12 +238,11 @@ resource "null_resource" "remote_service_setup" {
236238
OTEL_METRICS_EXPORTER=none \
237239
OTEL_LOGS_EXPORT=none \
238240
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
239-
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
240241
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
241242
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
242243
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
243244
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${var.test_id} \
244-
nohup java -jar remote-service.jar &> nohup.out &
245+
nohup java -XX:+UseG1GC -jar remote-service.jar &> nohup.out &
245246
246247
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
247248
sleep 30

terraform/java/ecs/resources/main-service.json.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
"name": "OTEL_AWS_APPLICATION_SIGNALS_ENABLED",
2323
"value": "true"
2424
},
25-
{
26-
"name": "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED",
27-
"value": "false"
28-
},
2925
{
3026
"name": "OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT",
3127
"value": "http://localhost:4316/v1/metrics"

terraform/java/eks/main.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ resource "kubernetes_deployment" "sample_app_deployment" {
123123
name = "RDS_MYSQL_CLUSTER_PASSWORD"
124124
value = var.rds_mysql_cluster_password
125125
}
126-
env {
127-
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
128-
value = "false"
129-
}
130126
port {
131127
container_port = 8080
132128
}
@@ -195,10 +191,6 @@ resource "kubernetes_deployment" "sample_remote_app_deployment" {
195191
port {
196192
container_port = 8080
197193
}
198-
env {
199-
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
200-
value = "false"
201-
}
202194
}
203195
}
204196
}

terraform/java/k8s/deploy/resources/frontend-service-depl.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ spec:
1919
containers:
2020
- name: frontend
2121
image: ${IMAGE}
22+
imagePullPolicy: Always
2223
ports:
2324
- containerPort: 8080
2425
env:
2526
- name: "OTEL_SERVICE_NAME"
2627
value: "sample-application-${TESTING_ID}"
27-
- name: "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
28-
value: "false"
2928
imagePullSecrets:
3029
- name: ecr-secret

terraform/java/k8s/deploy/resources/remote-service-depl.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ spec:
1919
containers:
2020
- name: remote
2121
image: ${IMAGE}
22+
imagePullPolicy: Always
2223
ports:
2324
- containerPort: 8081
24-
env:
25-
- name: OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED
26-
value: "false"
2725
imagePullSecrets:
2826
- name: ecr-secret

terraform/python/ec2/asg/main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ resource "aws_launch_configuration" "launch_configuration" {
160160
export OTEL_METRICS_EXPORTER=none
161161
export OTEL_TRACES_EXPORTER=otlp
162162
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
163-
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
164163
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
165164
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
166165
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
@@ -295,7 +294,6 @@ resource "null_resource" "remote_service_setup" {
295294
export OTEL_METRICS_EXPORTER=none
296295
export OTEL_TRACES_EXPORTER=otlp
297296
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
298-
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
299297
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
300298
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
301299
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc

0 commit comments

Comments
 (0)