Skip to content

Commit

Permalink
Add E2E test cases for runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
bjrara committed Nov 21, 2024
1 parent 308a522 commit 203540c
Show file tree
Hide file tree
Showing 32 changed files with 105 additions and 62 deletions.
9 changes: 5 additions & 4 deletions terraform/java/ec2/asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ resource "aws_launch_configuration" "launch_configuration" {
sudo yum install java-${var.language_version}-amazon-corretto -y
fi
# enable ec2 instance connect for debug
sudo yum install ec2-instance-connect -y
# 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
Expand All @@ -128,12 +131,11 @@ resource "aws_launch_configuration" "launch_configuration" {
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORT=none \
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${var.test_id} \
nohup java -jar main-service.jar &> nohup.out &
nohup java -jar -XX:+UseG1GC main-service.jar &> nohup.out &
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
sleep 30
Expand Down Expand Up @@ -230,12 +232,11 @@ resource "null_resource" "remote_service_setup" {
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORT=none \
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${var.test_id} \
nohup java -jar remote-service.jar &> nohup.out &
nohup java -XX:+UseG1GC -jar remote-service.jar &> nohup.out &
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
sleep 30
Expand Down
9 changes: 5 additions & 4 deletions terraform/java/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,11 @@ resource "null_resource" "main_service_setup" {
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORT=none \
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-application-${var.test_id} \
nohup java -jar main-service.jar &> nohup.out &
nohup java -XX:+UseG1GC -jar main-service.jar &> nohup.out &
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
sleep 30
Expand Down Expand Up @@ -217,6 +216,9 @@ resource "null_resource" "remote_service_setup" {
sudo yum install java-${var.language_version}-amazon-corretto -y
fi
# enable ec2 instance connect for debug
sudo yum install ec2-instance-connect -y
# 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
Expand All @@ -236,12 +238,11 @@ resource "null_resource" "remote_service_setup" {
OTEL_METRICS_EXPORTER=none \
OTEL_LOGS_EXPORT=none \
OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true \
OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false \
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces \
OTEL_RESOURCE_ATTRIBUTES=service.name=sample-remote-application-${var.test_id} \
nohup java -jar remote-service.jar &> nohup.out &
nohup java -XX:+UseG1GC -jar remote-service.jar &> nohup.out &
# The application needs time to come up and reach a steady state, this should not take longer than 30 seconds
sleep 30
Expand Down
4 changes: 0 additions & 4 deletions terraform/java/ecs/resources/main-service.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
"name": "OTEL_AWS_APPLICATION_SIGNALS_ENABLED",
"value": "true"
},
{
"name": "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED",
"value": "false"
},
{
"name": "OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT",
"value": "http://localhost:4316/v1/metrics"
Expand Down
8 changes: 0 additions & 8 deletions terraform/java/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ resource "kubernetes_deployment" "sample_app_deployment" {
name = "RDS_MYSQL_CLUSTER_PASSWORD"
value = var.rds_mysql_cluster_password
}
env {
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value = "false"
}
port {
container_port = 8080
}
Expand Down Expand Up @@ -195,10 +191,6 @@ resource "kubernetes_deployment" "sample_remote_app_deployment" {
port {
container_port = 8080
}
env {
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value = "false"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ spec:
env:
- name: "OTEL_SERVICE_NAME"
value: "sample-application-${TESTING_ID}"
- name: "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value: "false"
imagePullSecrets:
- name: ecr-secret
3 changes: 0 additions & 3 deletions terraform/java/k8s/deploy/resources/remote-service-depl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ spec:
image: ${IMAGE}
ports:
- containerPort: 8081
env:
- name: OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED
value: "false"
imagePullSecrets:
- name: ecr-secret
2 changes: 0 additions & 2 deletions terraform/python/ec2/asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ resource "aws_launch_configuration" "launch_configuration" {
export OTEL_METRICS_EXPORTER=none
export OTEL_TRACES_EXPORTER=otlp
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
Expand Down Expand Up @@ -295,7 +294,6 @@ resource "null_resource" "remote_service_setup" {
export OTEL_METRICS_EXPORTER=none
export OTEL_TRACES_EXPORTER=otlp
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
Expand Down
8 changes: 6 additions & 2 deletions terraform/python/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ resource "null_resource" "main_service_setup" {
sudo dnf install -y python${var.language_version}-pip
fi
# enable ec2 instance connect for debug
sudo yum install ec2-instance-connect -y
# 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
Expand Down Expand Up @@ -170,7 +173,6 @@ resource "null_resource" "main_service_setup" {
export OTEL_METRICS_EXPORTER=none
export OTEL_TRACES_EXPORTER=otlp
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
Expand Down Expand Up @@ -269,6 +271,9 @@ resource "null_resource" "remote_service_setup" {
sudo dnf install -y python${var.language_version}-pip
fi
# enable ec2 instance connect for debug
sudo yum install ec2-instance-connect -y
# 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
Expand Down Expand Up @@ -298,7 +303,6 @@ resource "null_resource" "remote_service_setup" {
export OTEL_METRICS_EXPORTER=none
export OTEL_TRACES_EXPORTER=otlp
export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
export OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED=false
export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4315
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
Expand Down
4 changes: 0 additions & 4 deletions terraform/python/ecs/resources/main-service.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
"name": "OTEL_AWS_APPLICATION_SIGNALS_ENABLED",
"value": "true"
},
{
"name": "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED",
"value": "false"
},
{
"name": "OTEL_RESOURCE_ATTRIBUTES",
"value": "service.name=${app_service_name}"
Expand Down
8 changes: 0 additions & 8 deletions terraform/python/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ resource "kubernetes_deployment" "python_app_deployment" {
name = "RDS_MYSQL_CLUSTER_PASSWORD"
value = var.rds_mysql_cluster_password
}
env {
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value = "false"
}
port {
container_port = 8000
}
Expand Down Expand Up @@ -209,10 +205,6 @@ resource "kubernetes_deployment" "python_r_app_deployment" {
name = "DJANGO_SETTINGS_MODULE"
value = "django_remote_service.settings"
}
env {
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value = "false"
}
port {
container_port = 8001
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ spec:
value: "/django_frontend_app"
- name: "DJANGO_SETTINGS_MODULE"
value: "django_frontend_service.settings"
- name: "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value: "false"
imagePullSecrets:
- name: ecr-secret
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ spec:
value: "/django_remote_app"
- name: "DJANGO_SETTINGS_MODULE"
value: "django_remote_service.settings"
- name: "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value: "false"
ports:
- containerPort: 8001
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "JAVA_EC2_ASG_CLIENT_CALL_LOG"

-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "JAVA_EC2_ASG_CLIENT_CALL_METRIC"

-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "JAVA_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_LOG"

-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "JAVA_EC2_DEFAULT_CLIENT_CALL_METRIC"

-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "JAVA_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "JAVA_ECS_HC_CALL_LOG"
expectedLogStructureTemplate: "JAVA_ECS_HC_CALL_LOG"
-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "JAVA_ECS_HC_CALL_METRIC"
expectedMetricTemplate: "JAVA_ECS_HC_CALL_METRIC"
-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "JAVA_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@
httpPath: "/mysql"
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "JAVA_EKS_RDS_MYSQL_LOG"
expectedLogStructureTemplate: "JAVA_EKS_RDS_MYSQL_LOG"
-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "JAVA_EKS_RDS_MYSQL_METRIC"
-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "JAVA_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
httpPath: "/client-call"
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "JAVA_K8S_CLIENT_CALL_LOG"
expectedLogStructureTemplate: "JAVA_K8S_CLIENT_CALL_LOG"
-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "JAVA_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "JAVA_K8S_CLIENT_CALL_METRIC"
-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "JAVA_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "PYTHON_EC2_ASG_CLIENT_CALL_LOG"

-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "PYTHON_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "PYTHON_EC2_ASG_CLIENT_CALL_METRIC"

-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "PYTHON_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedLogStructureTemplate: "PYTHON_EC2_DEFAULT_CLIENT_CALL_LOG"

-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "PYTHON_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
httpMethod: "get"
callingType: "http"
expectedMetricTemplate: "PYTHON_EC2_DEFAULT_CLIENT_CALL_METRIC"

-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "PYTHON_RUNTIME_METRIC"
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "PYTHON_ECS_HC_CALL_LOG"
expectedLogStructureTemplate: "PYTHON_ECS_HC_CALL_LOG"
-
validationType: "cw-log"
callingType: "none"
expectedLogStructureTemplate: "PYTHON_RUNTIME_METRIC_LOG"
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "PYTHON_ECS_HC_CALL_METRIC"
expectedMetricTemplate: "PYTHON_ECS_HC_CALL_METRIC"
-
validationType: "cw-metric"
callingType: "none"
expectedMetricTemplate: "PYTHON_RUNTIME_METRIC"
Loading

0 comments on commit 203540c

Please sign in to comment.