From cff55213b62b3afae22a766a48e317c42671bb0e Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 10 Nov 2021 16:03:48 +0900 Subject: [PATCH] e2e --- .../00-install-collector.yaml | 25 ++++++++++++++++ .../00-install-instrumentation.yaml | 12 ++++++++ .../e2e/instrumentation-nodejs/01-assert.yaml | 30 +++++++++++++++++++ .../01-install-app.yaml | 20 +++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 tests/e2e/instrumentation-nodejs/00-install-collector.yaml create mode 100644 tests/e2e/instrumentation-nodejs/00-install-instrumentation.yaml create mode 100644 tests/e2e/instrumentation-nodejs/01-assert.yaml create mode 100644 tests/e2e/instrumentation-nodejs/01-install-app.yaml diff --git a/tests/e2e/instrumentation-nodejs/00-install-collector.yaml b/tests/e2e/instrumentation-nodejs/00-install-collector.yaml new file mode 100644 index 0000000000..b823086361 --- /dev/null +++ b/tests/e2e/instrumentation-nodejs/00-install-collector.yaml @@ -0,0 +1,25 @@ +apiVersion: opentelemetry.io/v1alpha1 +kind: OpenTelemetryCollector +metadata: + name: sidecar +spec: + mode: sidecar + args: + metrics-level: detailed + config: | + receivers: + otlp: + protocols: + grpc: + http: + processors: + + exporters: + logging: + + service: + pipelines: + traces: + receivers: [otlp] + processors: [] + exporters: [logging] diff --git a/tests/e2e/instrumentation-nodejs/00-install-instrumentation.yaml b/tests/e2e/instrumentation-nodejs/00-install-instrumentation.yaml new file mode 100644 index 0000000000..a17642f744 --- /dev/null +++ b/tests/e2e/instrumentation-nodejs/00-install-instrumentation.yaml @@ -0,0 +1,12 @@ +apiVersion: opentelemetry.io/v1alpha1 +kind: Instrumentation +metadata: + name: nodejs +spec: + exporter: + endpoint: http://localhost:4317 + propagators: + - jaeger + - b3 + nodejs: + image: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-nodejs:latest diff --git a/tests/e2e/instrumentation-nodejs/01-assert.yaml b/tests/e2e/instrumentation-nodejs/01-assert.yaml new file mode 100644 index 0000000000..db5ff83555 --- /dev/null +++ b/tests/e2e/instrumentation-nodejs/01-assert.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: Pod +metadata: + annotations: + sidecar.opentelemetry.io/inject: "true" + instrumentation.opentelemetry.io/inject-nodejs: "true" + labels: + app: my-pod-with-sidecar +spec: + containers: + - name: myapp + env: + - name: OTEL_SERVICE_NAME + value: myapp + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://localhost:4317 + - name: OTEL_RESOURCE_ATTRIBUTES + - name: OTEL_PROPAGATORS + value: jaeger,b3 + - name: NODE_OPTIONS + value: " --require /otel-auto-instrumentation/autoinstrumentation.js" + volumeMounts: + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + - mountPath: /otel-auto-instrumentation + name: opentelemetry-auto-instrumentation + - name: otc-container + initContainers: + - name: opentelemetry-auto-instrumentation +status: + phase: Running diff --git a/tests/e2e/instrumentation-nodejs/01-install-app.yaml b/tests/e2e/instrumentation-nodejs/01-install-app.yaml new file mode 100644 index 0000000000..7514b59866 --- /dev/null +++ b/tests/e2e/instrumentation-nodejs/01-install-app.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: my-deployment-with-sidecar +spec: + selector: + matchLabels: + app: my-pod-with-sidecar + replicas: 1 + template: + metadata: + labels: + app: my-pod-with-sidecar + annotations: + sidecar.opentelemetry.io/inject: "true" + instrumentation.opentelemetry.io/inject-nodejs: "true" + spec: + containers: + - name: myapp + image: ghcr.io/anuraaga/express-hello-world:latest