@@ -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
0 commit comments