From 2962d7dea0008e3c052b6d6fd336a369fa5bccf3 Mon Sep 17 00:00:00 2001 From: jiaxiao zhou Date: Mon, 22 Jul 2024 22:11:39 +0000 Subject: [PATCH] added otel tests to the CI test-smoke Signed-off-by: jiaxiao zhou --- .github/workflows/action-test-smoke.yml | 4 ++++ scripts/setup-otel.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 scripts/setup-otel.sh diff --git a/.github/workflows/action-test-smoke.yml b/.github/workflows/action-test-smoke.yml index 7c23d4055..11bf9738d 100644 --- a/.github/workflows/action-test-smoke.yml +++ b/.github/workflows/action-test-smoke.yml @@ -36,6 +36,10 @@ jobs: with: name: test-img path: dist + - name: enable OTLP + if: ${{ inputs.runtime == 'wasmtime' }} + run: | + sudo ./scripts/setup-otel.sh - name: run timeout-minutes: 5 run: | diff --git a/scripts/setup-otel.sh b/scripts/setup-otel.sh new file mode 100755 index 000000000..75466dcb9 --- /dev/null +++ b/scripts/setup-otel.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# start jeager endpoint +docker run -d -p16686:16686 -p4317:4317 -p4318:4318 -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:latest + +systemctl stop containerd + +# Create a temporary file for the service override +TMPFILE=$(mktemp /tmp/containerd-override.XXXXXX) + +# Add the environment variable to the override file +cat < /etc/systemd/system/containerd.service.d/override.conf +[Service] +Environment="OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318" +Environment="OTEL_SERVICE_NAME=wasmtime" +EOF + +systemctl daemon-reload +systemctl restart containerd \ No newline at end of file