Skip to content

Commit

Permalink
Future fix for EKS and K8S.
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhlogin committed Dec 17, 2024
1 parent 18b2170 commit 1b380ea
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions terraform/java/ec2/asg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -237,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
1 change: 1 addition & 0 deletions terraform/java/ec2/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -243,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
4 changes: 4 additions & 0 deletions terraform/java/eks-otlp-ocb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,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
4 changes: 4 additions & 0 deletions terraform/java/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -192,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
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}}/remote-service(?:\\?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}}/aws-sdk-call(?:\\?ip=(([0-9]{1,3}\\.){3}[0-9]{1,3})&testingId={{testingId}})?$",
"method": "^GET$"
},
"response": {
Expand Down

0 comments on commit 1b380ea

Please sign in to comment.