Skip to content
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

Enable runtime metrics in canaries #326

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/java-ec2-default-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ jobs:
# Reusing the adot-main-build-staging-jar bucket to store the python wheel file
echo GET_ADOT_JAR_COMMAND="aws s3 cp s3://adot-main-build-staging-jar/aws-opentelemetry-agent.jar ./adot.jar" >> $GITHUB_ENV
elif [ "${{ env.OTEL_SOURCE }}" == "maven" ]; then
echo "Latest version for Maven is: 1.32.4"
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
echo "Latest version for Maven is: 1.32.5"
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
else
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
fi
Expand Down
1 change: 1 addition & 0 deletions sample-apps/java/springboot-main-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jib {
}
container {
mainClass = "com.amazon.sampleapp.FrontendService"
jvmFlags = listOf("-XX:+UseG1GC")
ports = listOf("8080")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jib {
}
container {
mainClass = "com.amazon.sampleapp.RemoteService"
jvmFlags = listOf("-XX:+UseG1GC")
ports = listOf("8080")
}
}
Expand Down
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
bjrara marked this conversation as resolved.
Show resolved Hide resolved

# 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 @@ -19,12 +19,11 @@ spec:
containers:
- name: frontend
image: ${IMAGE}
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: "OTEL_SERVICE_NAME"
value: "sample-application-${TESTING_ID}"
- name: "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value: "false"
imagePullSecrets:
- name: ecr-secret
4 changes: 1 addition & 3 deletions terraform/java/k8s/deploy/resources/remote-service-depl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ spec:
containers:
- name: remote
image: ${IMAGE}
imagePullPolicy: Always
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 @@ -19,6 +19,7 @@ spec:
containers:
- name: python-frontend
image: ${IMAGE}
imagePullPolicy: Always
args:
- "sh"
- "-c"
Expand All @@ -32,7 +33,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 @@ -19,6 +19,7 @@ spec:
containers:
- name: python-remote
image: ${IMAGE}
imagePullPolicy: Always
args:
- "sh"
- "-c"
Expand All @@ -28,8 +29,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"
bjrara marked this conversation as resolved.
Show resolved Hide resolved
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"
Loading