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

Update E2E test to ADOT Java V2.x change #336

Merged
merged 2 commits into from
Dec 18, 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
2 changes: 2 additions & 0 deletions terraform/java/ec2/asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ resource "aws_launch_configuration" "launch_configuration" {
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} \
OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \
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
Expand Down Expand Up @@ -236,6 +237,7 @@ resource "null_resource" "remote_service_setup" {
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} \
OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \
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
Expand Down
2 changes: 2 additions & 0 deletions terraform/java/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ resource "null_resource" "main_service_setup" {
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} \
OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \
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
Expand Down Expand Up @@ -242,6 +243,7 @@ resource "null_resource" "remote_service_setup" {
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} \
OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED=true \
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
Expand Down
6 changes: 5 additions & 1 deletion terraform/java/ecs/resources/main-service.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@
{
"name": "OTEL_PROPAGATORS",
"value": "tracecontext,baggage,b3,xray"
}
},
{
"name": "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED",
"value": "true"
}
],
"mountPoints": [
{
Expand Down
8 changes: 8 additions & 0 deletions terraform/java/eks-otlp-ocb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ resource "kubernetes_deployment" "sample_app_deployment" {
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value = "false"
}
env {
name = "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED"
value = "true"
}
port {
container_port = 8080
}
Expand Down Expand Up @@ -187,6 +191,10 @@ resource "kubernetes_deployment" "sample_remote_app_deployment" {
name = "OTEL_AWS_APPLICATION_SIGNALS_RUNTIME_ENABLED"
value = "false"
}
env {
name = "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED"
value = "true"
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions terraform/java/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ resource "kubernetes_deployment" "sample_app_deployment" {
name = "RDS_MYSQL_CLUSTER_PASSWORD"
value = var.rds_mysql_cluster_password
}
env {
name = "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED"
value = "true"
}
port {
container_port = 8080
}
Expand Down Expand Up @@ -188,6 +192,10 @@ resource "kubernetes_deployment" "sample_remote_app_deployment" {
name = "back-end"
image = var.sample_remote_app_image
image_pull_policy = "Always"
env {
name = "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED"
value = "true"
}
port {
container_port = 8080
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ spec:
env:
- name: "OTEL_SERVICE_NAME"
value: "sample-application-${TESTING_ID}"
- name: "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED"
value: "true"
imagePullSecrets:
- name: ecr-secret
3 changes: 3 additions & 0 deletions terraform/java/k8s/deploy/resources/remote-service-depl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: 8081
env:
- name: "OTEL_INSTRUMENTATION_COMMON_EXPERIMENTAL_CONTROLLER_TELEMETRY_ENABLED"
value: "true"
imagePullSecrets:
- name: ecr-secret
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/remote-service(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
},
{
"name": "^www.amazon.com$"
}]
}]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/remote-service(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down Expand Up @@ -94,6 +94,4 @@
}
}
]
}]


}]
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"PlatformType": "^AWS::ECS$",
"Service": "^{{serviceName}}$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.Source": "^LocalRootSpan$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"aws": {
"account_id": "^{{accountId}}$",
"xray": {
"auto_instrumentation": true,
"auto_instrumentation": "^(true|false)$",
"sdk": "^opentelemetry for"
}
},
Expand Down Expand Up @@ -42,7 +42,7 @@
"aws": {
"account_id": "^{{accountId}}$",
"xray": {
"auto_instrumentation": true,
"auto_instrumentation": "^(true|false)$",
"sdk": "^opentelemetry for"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/remote-service(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -33,6 +33,6 @@
"RemoteResourceType": "AWS::S3::Bucket",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/aws-sdk-call\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -31,6 +31,6 @@
"RemoteOperation": "GET /",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -31,7 +31,7 @@
"RemoteOperation": "GET /",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -32,6 +32,6 @@
"RemoteOperation": "GET /healthcheck",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),java,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),java,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "^{{serviceName}}$",
"http": {
"request": {
"url": "^{{endpoint}}/remote-service\\?ip=(([0-9]{1,3}.){3}[0-9]{1,3})&testingId={{testingId}}$",
"url": "^{{endpoint}}/remote-service(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[{
"Telemetry.SDK": "opentelemetry,.*,java,Auto",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),.*,java,Auto",
"Telemetry.Source": "^RuntimeMetric$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"PlatformType": "^AWS::ECS$",
"Service": "^{{serviceName}}$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.Source": "^LocalRootSpan$",
"aws.log.group.names": "^/ecs/node-e2e-test$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}.*$"
},
{
Expand All @@ -35,6 +35,6 @@
"RemoteResourceType": "^AWS::S3::Bucket$",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}.*$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -33,6 +33,6 @@
"RemoteResourceType": "AWS::S3::Bucket",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -31,6 +31,6 @@
"RemoteOperation": "GET /",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Version": "^1$",
"Telemetry.Source": "^LocalRootSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
},
{
Expand All @@ -31,7 +31,7 @@
"RemoteOperation": "GET /",
"Telemetry.Source": "^ClientSpan$",
"Telemetry.Agent": "^CWAgent\/([A-Za-z0-9.-]*)$",
"Telemetry.SDK": "^opentelemetry,([A-Za-z0-9-.]*),nodejs,Auto$",
"Telemetry.SDK": "^(opentelemetry|opentelemetry-java-instrumentation),([A-Za-z0-9-.]*),nodejs,Auto$",
"Host": "^ip(-[0-9]{1,3}){4}\\.ec2\\.internal$"
}]

Loading
Loading