Skip to content

Customized grouping through ADOT instrumentation #120

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion cdk/ec2/lib/user-data/customers-user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ tmux send-keys -t customers "export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true" C
tmux send-keys -t customers "export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics" C-m
tmux send-keys -t customers "export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf" C-m
tmux send-keys -t customers "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces" C-m
tmux send-keys -t customers "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name}\"" C-m
tmux send-keys -t customers "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name},Team=Frontend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit\"" C-m
tmux send-keys -t customers "export SPRING_PROFILES_ACTIVE=ec2" C-m
tmux send-keys -t customers "java -jar spring-petclinic-customer*.jar" C-m
EOF
2 changes: 1 addition & 1 deletion cdk/ec2/lib/user-data/pet-clinic-frontend-user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ tmux send-keys -t frontend "export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true" C-
tmux send-keys -t frontend "export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics" C-m
tmux send-keys -t frontend "export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf" C-m
tmux send-keys -t frontend "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces" C-m
tmux send-keys -t frontend "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name}\"" C-m
tmux send-keys -t frontend "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=pet-clinic-frontend-ec2-java,Team=Frontend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit\"" C-m
tmux send-keys -t frontend "export SPRING_PROFILES_ACTIVE=ec2" C-m
tmux send-keys -t frontend "java -jar spring-petclinic-api-gateway-*.jar" C-m

Expand Down
2 changes: 1 addition & 1 deletion cdk/ec2/lib/user-data/vets-user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ tmux send-keys -t vets "export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true" C-m
tmux send-keys -t vets "export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics" C-m
tmux send-keys -t vets "export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf" C-m
tmux send-keys -t vets "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces" C-m
tmux send-keys -t vets "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name}\"" C-m
tmux send-keys -t vets "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name},Team=Frontend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit\"" C-m
tmux send-keys -t vets "export SPRING_PROFILES_ACTIVE=ec2" C-m
tmux send-keys -t vets "java -jar spring-petclinic-vet*.jar" C-m
EOF
2 changes: 1 addition & 1 deletion cdk/ec2/lib/user-data/visits-user-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ tmux send-keys -t visits "export OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true" C-m
tmux send-keys -t visits "export OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT=http://localhost:4316/v1/metrics" C-m
tmux send-keys -t visits "export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf" C-m
tmux send-keys -t visits "export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4316/v1/traces" C-m
tmux send-keys -t visits "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name}\"" C-m
tmux send-keys -t visits "export OTEL_RESOURCE_ATTRIBUTES=\"service.name=${service_name},Team=Frontend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit\"" C-m
# tmux send-keys -t visits "export SPRING_PROFILES_ACTIVE=ec2" C-m
tmux send-keys -t visits "java -jar spring-petclinic-visit*.jar" C-m
EOF
4 changes: 2 additions & 2 deletions cdk/ecs/lib/stacks/ecsStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ export class EcsClusterStack extends Stack {
OTEL_TRACES_SAMPLER: 'xray',
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://localhost:4316/v1/traces',
OTEL_PROPAGATORS: 'tracecontext,baggage,b3,xray',
OTEL_RESOURCE_ATTRIBUTES: `aws.log.group.names=${logGroup.logGroupName},service.name=${serviceName}`,
OTEL_RESOURCE_ATTRIBUTES: `aws.log.group.names=${logGroup.logGroupName},service.name=${serviceName},Team=Frontend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit`,
OTEL_AWS_APPLICATION_SIGNALS_ENABLED: 'true',
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT: 'http://localhost:4316/v1/metrics',
OTEL_METRICS_EXPORTER: 'none',
Expand Down Expand Up @@ -628,7 +628,7 @@ export class EcsClusterStack extends Stack {
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://localhost:4316/v1/traces',
OTEL_AWS_APPLICATION_SIGNALS_EXPORTER_ENDPOINT: 'http://localhost:4316/v1/metrics',
OTEL_AWS_APPLICATION_SIGNALS_ENABLED: 'true',
OTEL_RESOURCE_ATTRIBUTES: `service.name=${serviceName}`,
OTEL_RESOURCE_ATTRIBUTES: `service.name=${serviceName}, Team=Frontend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit`,
OTEL_METRICS_EXPORTER: 'none',
OTEL_PYTHON_DISTRO: 'aws_distro',
EUREKA_SERVER_URL: `${this.DISCOVERY_SERVER}-DNS.${this.serviceDiscoveryStack.namespace.namespaceName}`,
Expand Down
2 changes: 2 additions & 0 deletions cdk/eks/lib/manifests/sample-app/api-gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ spec:
value: "${APP_MONITOR_IDENTITY_POOL_ID}"
- name: APP_MONITOR_ID
value: "${APP_MONITOR_ID}"
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ spec:
value: <HOST>
- name: DB_SERVICE_PORT
value: '5432'
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
# command: ["sh", "-c"]
# args: ['manage.py', 'runserver', '0.0.0.0:8000']
command: ['sh', '-c']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ spec:
name: customers-service-java
ports:
- containerPort: 8081
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
restartPolicy: Always
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
- java
- org.springframework.boot.loader.JarLauncher
image: 111122223333.dkr.ecr.us-west-2.amazonaws.com/springcommunity/spring-petclinic-discovery-server:latest
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
value: <HOST>
- name: DB_SERVICE_PORT
value: '5432'
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
# command: ["sh", "-c"]
# args: ['manage.py', 'runserver', '0.0.0.0:8000']
command: ['sh', '-c']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
value: http://discovery-server:8761/eureka
- name: MONGO_URI
value: mongodb://admin:admin@mongodb:27017/
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
ports:
- containerPort: 3000
imagePullPolicy: Always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ spec:
value: "true"
- name: eureka__instance__port
value: "8089"
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"

ports:
- containerPort: 8089
Expand Down
3 changes: 3 additions & 0 deletions cdk/eks/lib/manifests/sample-app/vets-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
- java
- org.springframework.boot.loader.JarLauncher
image: 111122223333.dkr.ecr.us-west-2.amazonaws.com/springcommunity/spring-petclinic-vets-service:latest
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ spec:
env:
- name: OTEL_INSTRUMENTATION_AWS_SDK_EXPERIMENTAL_SPAN_ATTRIBUTES
value: "true"
- name: OTEL_RESOURCE_ATTRIBUTES
value: "Team=Backend,Organization=Marketplace,BusinessUnit=E-commerce,aws.application_signals.metric_resource_keys=Team&Organization&BusinessUnit"
image: 111122223333.dkr.ecr.us-west-2.amazonaws.com/springcommunity/spring-petclinic-visits-service:latest
securityContext:
runAsNonRoot: true
Expand Down