Skip to content

Commit

Permalink
Fix multi instrumentation test asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
IshwarKanse committed Mar 5, 2024
1 parent 6042a4d commit adb4161
Show file tree
Hide file tree
Showing 9 changed files with 433 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,128 +2,232 @@ apiVersion: v1
kind: Pod
metadata:
annotations:
instrumentation.opentelemetry.io/container-names: "shouldnt-be-instrumented"
instrumentation.opentelemetry.io/dotnet-container-names: "dotnetapp"
instrumentation.opentelemetry.io/container-names: shouldnt-be-instrumented
instrumentation.opentelemetry.io/dotnet-container-names: dotnetapp
instrumentation.opentelemetry.io/inject-dotnet: "true"
instrumentation.opentelemetry.io/inject-java: "true"
instrumentation.opentelemetry.io/inject-nodejs: "true"
instrumentation.opentelemetry.io/inject-python: "true"
instrumentation.opentelemetry.io/java-container-names: "javaapp"
instrumentation.opentelemetry.io/nodejs-container-names: "nodejsapp"
instrumentation.opentelemetry.io/python-container-names: "pythonapp"
instrumentation.opentelemetry.io/java-container-names: javaapp
instrumentation.opentelemetry.io/nodejs-container-names: nodejsapp
instrumentation.opentelemetry.io/python-container-names: pythonapp
sidecar.opentelemetry.io/inject: "true"
labels:
app: pod-with-multi-instrumentation
spec:
containers:
- name: dotnetapp
env:
- name: OTEL_SERVICE_NAME
value: dotnetapp
- name: CORECLR_ENABLE_PROFILING
value: "1"
- name: CORECLR_PROFILER
value: "{918728DD-259F-4A6A-AC2B-B85E1B658318}"
- name: CORECLR_PROFILER_PATH
value: /otel-auto-instrumentation-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
- name: DOTNET_STARTUP_HOOKS
value: /otel-auto-instrumentation-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
- name: DOTNET_ADDITIONAL_DEPS
value: /otel-auto-instrumentation-dotnet/AdditionalDeps
- name: OTEL_DOTNET_AUTO_HOME
value: /otel-auto-instrumentation-dotnet
- name: DOTNET_SHARED_STORE
value: /otel-auto-instrumentation-dotnet/store
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- mountPath: /otel-auto-instrumentation-dotnet
name: opentelemetry-auto-instrumentation-dotnet
- name: javaapp
env:
- name: OTEL_SERVICE_NAME
value: javaapp
- name: JAVA_TOOL_OPTIONS
value: " -javaagent:/otel-auto-instrumentation-java/javaagent.jar"
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- mountPath: /otel-auto-instrumentation-java
name: opentelemetry-auto-instrumentation-java
- name: nodejsapp
env:
- name: OTEL_SERVICE_NAME
value: nodejsapp
- name: NODE_OPTIONS
value: ' --require /otel-auto-instrumentation-nodejs/autoinstrumentation.js'
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- mountPath: /otel-auto-instrumentation-nodejs
name: opentelemetry-auto-instrumentation-nodejs
- name: pythonapp
env:
- name: OTEL_SERVICE_NAME
value: pythonapp
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4318
- name: PYTHONPATH
value: /otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python
- name: OTEL_TRACES_EXPORTER
value: otlp
- name: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL
value: http/protobuf
- name: OTEL_METRICS_EXPORTER
value: otlp
- name: OTEL_EXPORTER_OTLP_METRICS_PROTOCOL
value: http/protobuf
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- mountPath: /otel-auto-instrumentation-python
name: opentelemetry-auto-instrumentation-python
- name: shouldnt-be-instrumented
env:
- name: TEST
value: test
- name: otc-container
- env:
- name: ASPNETCORE_URLS
value: http://+:8083
- name: OTEL_SERVICE_NAME
value: dotnetapp
- name: CORECLR_ENABLE_PROFILING
value: "1"
- name: CORECLR_PROFILER
value: '{918728DD-259F-4A6A-AC2B-B85E1B658318}'
- name: CORECLR_PROFILER_PATH
value: /otel-auto-instrumentation-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so
- name: DOTNET_STARTUP_HOOKS
value: /otel-auto-instrumentation-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll
- name: DOTNET_ADDITIONAL_DEPS
value: /otel-auto-instrumentation-dotnet/AdditionalDeps
- name: OTEL_DOTNET_AUTO_HOME
value: /otel-auto-instrumentation-dotnet
- name: DOTNET_SHARED_STORE
value: /otel-auto-instrumentation-dotnet/store
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
name: dotnetapp
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- mountPath: /otel-auto-instrumentation-dotnet
name: opentelemetry-auto-instrumentation-dotnet
- env:
- name: OTEL_SERVICE_NAME
value: javaapp
- name: JAVA_TOOL_OPTIONS
value: ' -javaagent:/otel-auto-instrumentation-java/javaagent.jar'
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
name: javaapp
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- mountPath: /otel-auto-instrumentation-java
name: opentelemetry-auto-instrumentation-java
- env:
- name: NODE_PATH
value: /usr/local/lib/node_modules
- name: OTEL_SERVICE_NAME
value: nodejsapp
- name: NODE_OPTIONS
value: ' --require /otel-auto-instrumentation-nodejs/autoinstrumentation.js'
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4317
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
name: nodejsapp
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- mountPath: /otel-auto-instrumentation-nodejs
name: opentelemetry-auto-instrumentation-nodejs
- command:
- flask
- run
- -p
- "8087"
env:
- name: OTEL_SERVICE_NAME
value: pythonapp
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://localhost:4318
- name: PYTHONPATH
value: /otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python
- name: OTEL_TRACES_EXPORTER
value: otlp
- name: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL
value: http/protobuf
- name: OTEL_METRICS_EXPORTER
value: otlp
- name: OTEL_EXPORTER_OTLP_METRICS_PROTOCOL
value: http/protobuf
- name: OTEL_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.85"
- name: OTEL_RESOURCE_ATTRIBUTES_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_RESOURCE_ATTRIBUTES_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_PROPAGATORS
value: jaeger,b3
- name: OTEL_RESOURCE_ATTRIBUTES
name: pythonapp
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- mountPath: /otel-auto-instrumentation-python
name: opentelemetry-auto-instrumentation-python
- env:
- name: TEST
value: test
name: shouldnt-be-instrumented
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- args:
- --config=env:OTEL_CONFIG
name: otc-container
initContainers:
- name: opentelemetry-auto-instrumentation-java
volumeMounts:
- mountPath: /otel-auto-instrumentation-java
name: opentelemetry-auto-instrumentation-java
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- name: opentelemetry-auto-instrumentation-nodejs
volumeMounts:
- mountPath: /otel-auto-instrumentation-nodejs
name: opentelemetry-auto-instrumentation-nodejs
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- name: opentelemetry-auto-instrumentation-python
volumeMounts:
- mountPath: /otel-auto-instrumentation-python
name: opentelemetry-auto-instrumentation-python
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
- name: opentelemetry-auto-instrumentation-dotnet
volumeMounts:
- mountPath: /otel-auto-instrumentation-dotnet
name: opentelemetry-auto-instrumentation-dotnet
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
status:
phase: Running
containerStatuses:
- name: dotnetapp
ready: true
started: true
- name: javaapp
ready: true
started: true
- name: nodejsapp
ready: true
started: true
- name: otc-container
ready: true
started: true
- name: pythonapp
ready: true
started: true
- name: shouldnt-be-instrumented
ready: true
started: true
initContainerStatuses:
- name: opentelemetry-auto-instrumentation-java
ready: true
- name: opentelemetry-auto-instrumentation-nodejs
ready: true
- name: opentelemetry-auto-instrumentation-python
ready: true
- name: opentelemetry-auto-instrumentation-dotnet
ready: true
started: false
phase: Running
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,48 @@ spec:
instrumentation.opentelemetry.io/python-container-names: "pythonapp"
sidecar.opentelemetry.io/inject: "true"
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 3000
containers:
- name: dotnetapp
image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-dotnet:main
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
env:
- name: ASPNETCORE_URLS
value: "http://+:8083"
- name: javaapp
image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-java:main
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
- name: nodejsapp
image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-nodejs:main
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
env:
- name: NODE_PATH
value: /usr/local/lib/node_modules
- name: pythonapp
image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-python:main
command: ["flask", "run", "-p", "8087"]
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
- name: shouldnt-be-instrumented
image: rabbitmq:3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
env:
- name: TEST
value: test
Loading

0 comments on commit adb4161

Please sign in to comment.