From ef535640e3a95a2a2b954170111fdac9d7617634 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 | 18 ++++++++++++++++++ 2 files changed, 22 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..a8e525ee7 --- /dev/null +++ b/scripts/setup-otel.sh @@ -0,0 +1,18 @@ +#!/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 + +mkdir -p /etc/systemd/system/containerd.service.d + +# 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