Skip to content

Commit

Permalink
Fix instrumentation test asserts. (open-telemetry#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
IshwarKanse authored Mar 12, 2024
1 parent be172d9 commit b95fa75
Show file tree
Hide file tree
Showing 63 changed files with 1,336 additions and 580 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,19 @@ spec:
- --config=env:OTEL_CONFIG
name: otc-container
initContainers:
- args:
- cp -r /usr/local/apache2/conf/* /opt/opentelemetry-webserver/source-conf
name: otel-agent-source-container-clone
- args:
- cp -r /opt/opentelemetry/* /opt/opentelemetry-webserver/agent && export agentLogDir=$(echo "/opt/opentelemetry-webserver/agent/logs" | sed 's,/,\\/,g') && cat /opt/opentelemetry-webserver/agent/conf/appdynamics_sdk_log4cxx.xml.template | sed 's/__agent_log_dir__/'${agentLogDir}'/g' > /opt/opentelemetry-webserver/agent/conf/appdynamics_sdk_log4cxx.xml &&echo "$OTEL_APACHE_AGENT_CONF" > /opt/opentelemetry-webserver/source-conf/opentemetry_agent.conf && sed -i 's/<<SID-PLACEHOLDER>>/'${APACHE_SERVICE_INSTANCE_ID}'/g' /opt/opentelemetry-webserver/source-conf/opentemetry_agent.conf && echo 'Include /usr/local/apache2/conf/opentemetry_agent.conf' >> /opt/opentelemetry-webserver/source-conf/httpd.conf
name: otel-agent-attach-apache
- name: otel-agent-source-container-clone
- name: otel-agent-attach-apache
status:
containerStatuses:
- name: myapp
ready: true
started: true
- name: otc-container
ready: true
started: true
initContainerStatuses:
- name: otel-agent-source-container-clone
ready: true
- name: otel-agent-attach-apache
ready: true
phase: Running
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
- annotate
- namespace
- ${NAMESPACE}
- openshift.io/sa.scc.supplemental-groups=3000/1000
- openshift.io/sa.scc.supplemental-groups=3000/3000
- --overwrite
- apply:
file: 00-install-collector.yaml
Expand All @@ -34,3 +34,6 @@ spec:
file: 01-install-app.yaml
- assert:
file: 01-assert.yaml
catch:
- podLogs:
selector: app=my-apache
Original file line number Diff line number Diff line change
@@ -1,71 +1,80 @@
# skipping test, see https://github.com/open-telemetry/opentelemetry-operator/issues/1936
apiVersion: v1
kind: Pod
metadata:
annotations:
sidecar.opentelemetry.io/inject: "true"
instrumentation.opentelemetry.io/container-names: myapp,myrabbit
instrumentation.opentelemetry.io/inject-apache-httpd: "true"
instrumentation.opentelemetry.io/container-names: "myapp,myrabbit"
sidecar.opentelemetry.io/inject: "true"
labels:
app: my-apache
app: my-apache-multi
spec:
containers:
- env:
- name: OTEL_SERVICE_NAME
value: my-apache
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myapp
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- mountPath: /opt/opentelemetry-webserver/agent
name: otel-apache-agent
- mountPath: /usr/local/apache2/conf
name: otel-apache-conf-dir
- env:
- name: OTEL_SERVICE_NAME
value: my-apache
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myrabbit
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- args:
- --config=env:OTEL_CONFIG
name: otc-container
- env:
- name: OTEL_SERVICE_NAME
value: my-apache-multi
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myapp
- env:
- name: OTEL_SERVICE_NAME
value: my-apache-multi
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myrabbit
- args:
- --config=env:OTEL_CONFIG
name: otc-container
initContainers:
- name: otel-agent-source-container-clone
- name: otel-agent-attach-apache
status:
containerStatuses:
- name: myapp
ready: true
started: true
- name: myrabbit
ready: true
started: true
- name: otc-container
ready: true
started: true
initContainerStatuses:
- name: otel-agent-source-container-clone
ready: true
- name: otel-agent-attach-apache
ready: true
phase: Running
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# skipping test, see https://github.com/open-telemetry/opentelemetry-operator/issues/1936
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-apache
name: my-apache-multi
spec:
selector:
matchLabels:
app: my-apache
app: my-apache-multi
replicas: 1
template:
metadata:
labels:
app: my-apache
app: my-apache-multi
annotations:
sidecar.opentelemetry.io/inject: "true"
instrumentation.opentelemetry.io/inject-apache-httpd: "true"
instrumentation.opentelemetry.io/container-names: "myapp,myrabbit"
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 3000
containers:
- name: myapp
image: docker.io/chrlic/apache-test@sha256:fad58c6ce7a4f477b455bece2a1980741fa6f81cef1e1093a3b72f9b2ffa7b8e
# image source at https://github.com/cisco-open/appdynamics-k8s-webhook-instrumentor/tree/main/testWorkloads/apache-httpd
# licensed under Apache 2.0
image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-apache-httpd:main
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand All @@ -32,5 +33,13 @@ spec:
requests:
cpu: 250m
memory: 100Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
- name: myrabbit
image: rabbitmq
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
# skipping test, see https://github.com/open-telemetry/opentelemetry-operator/issues/1936
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-apache-multi
status:
availableReplicas: 1
readyReplicas: 1
replicas: 1
updatedReplicas: 1

---
apiVersion: v1
kind: Pod
metadata:
annotations:
instrumentation.opentelemetry.io/container-names: myapp
instrumentation.opentelemetry.io/inject-apache-httpd: "true"
sidecar.opentelemetry.io/inject: "true"
labels:
app: my-apache
app: my-apache-multi
spec:
containers:
- env:
- name: OTEL_SERVICE_NAME
value: my-apache
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myapp
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
- mountPath: /opt/opentelemetry-webserver/agent
name: otel-apache-agent
- mountPath: /usr/local/apache2/conf
name: otel-apache-conf-dir
- env:
- name: OTEL_SERVICE_NAME
value: my-apache
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myrabbit
- args:
- --config=env:OTEL_CONFIG
name: otc-container
- env:
- name: OTEL_SERVICE_NAME
value: my-apache-multi
- 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_TRACES_SAMPLER
value: parentbased_traceidratio
- name: OTEL_TRACES_SAMPLER_ARG
value: "0.25"
- name: OTEL_RESOURCE_ATTRIBUTES
name: myapp
- image: rabbitmq
name: myrabbit
- args:
- --config=env:OTEL_CONFIG
name: otc-container
initContainers:
- name: otel-agent-source-container-clone
- name: otel-agent-attach-apache
status:
containerStatuses:
- name: myapp
ready: true
started: true
- name: myrabbit
ready: true
started: true
- name: otc-container
ready: true
started: true
initContainerStatuses:
- name: otel-agent-source-container-clone
ready: true
- name: otel-agent-attach-apache
ready: true
phase: Running
Loading

0 comments on commit b95fa75

Please sign in to comment.