From ae891f7fc01a983a1a22b96d919cdaf4ef050a5b Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 9 Mar 2025 16:47:02 +0200 Subject: [PATCH 1/6] run e2e tests on arm --- .github/workflows/kind.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index f6328f87f..6f5de3574 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -30,7 +30,8 @@ jobs: matrix: k8s-version: ["v1.26.0"] library: ["autosdk", "nethttp", "nethttp_custom", "gin", "databasesql", "grpc", "otelglobal", "kafka-go"] - runs-on: ubuntu-latest + runner: [ubuntu-latest, ubuntu-22.04-arm] + runs-on: ${{ matrix.runner }} steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 From 71c8100ac42907e22b1b5f0e68f09c57e78014ac Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 9 Mar 2025 16:58:36 +0200 Subject: [PATCH 2/6] build for arm in e2e workflow --- .github/workflows/kind.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 6f5de3574..453f5f57d 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -10,7 +10,10 @@ on: jobs: build-auto-instrumentation: - runs-on: ubuntu-latest + strategy: + matrix: + runner: [ubuntu-latest, ubuntu-22.04-arm] + runs-on: ${{ matrix.runner }} steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 @@ -21,8 +24,9 @@ jobs: - name: Upload Docker image artifact uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 with: - name: otel-go-instrumentation - path: otel-go-instrumentation.tar + name: otel-go-instrumentation-${{ matrix.runner }} + path: otel-go-instrumentation-${{ matrix.runner }}.tar + kubernetes-test: needs: - build-auto-instrumentation @@ -59,10 +63,10 @@ jobs: - name: Download Docker image artifact uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4 with: - name: otel-go-instrumentation + name: otel-go-instrumentation-${{ matrix.runner }} - name: Load Docker image run: | - docker load -i otel-go-instrumentation.tar + ocker load -i otel-go-instrumentation-${{ matrix.runner }}.tar - name: Kind load images run: | kind load docker-image otel-go-instrumentation --name chart-testing From 8731359b1208cc4e771b0548a0b92d5e6ce03920 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 9 Mar 2025 17:05:52 +0200 Subject: [PATCH 3/6] fix CI --- .github/workflows/kind.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 453f5f57d..6c57f629e 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -20,7 +20,7 @@ jobs: - name: Build auto-instrumentation run: | IMG=otel-go-instrumentation:latest make docker-build - docker save otel-go-instrumentation:latest -o otel-go-instrumentation.tar + docker save otel-go-instrumentation:latest -o otel-go-instrumentation-${{ matrix.runner }}.tar - name: Upload Docker image artifact uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 with: From bb4326d91f8a70bd6277afdb8c626299795a787d Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 9 Mar 2025 17:10:53 +0200 Subject: [PATCH 4/6] fix CI again --- .github/workflows/kind.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 6c57f629e..c4bab4b45 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -66,7 +66,7 @@ jobs: name: otel-go-instrumentation-${{ matrix.runner }} - name: Load Docker image run: | - ocker load -i otel-go-instrumentation-${{ matrix.runner }}.tar + docker load -i otel-go-instrumentation-${{ matrix.runner }}.tar - name: Kind load images run: | kind load docker-image otel-go-instrumentation --name chart-testing From 132db0e1fd575be6bf6551051f52013780a07567 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Mon, 10 Mar 2025 23:13:05 +0200 Subject: [PATCH 5/6] redact both valids archs in tests --- internal/test/e2e/autosdk/traces.json | 2 +- internal/test/e2e/databasesql/traces.json | 2 +- internal/test/e2e/gin/traces.json | 2 +- internal/test/e2e/grpc/traces.json | 2 +- internal/test/e2e/kafka-go/traces.json | 2 +- internal/test/e2e/nethttp/traces.json | 2 +- internal/test/e2e/nethttp_custom/traces.json | 2 +- internal/test/e2e/otelglobal/traces.json | 2 +- internal/test/test_helpers/utilities.sh | 11 ++++++++--- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/internal/test/e2e/autosdk/traces.json b/internal/test/e2e/autosdk/traces.json index 5361fa594..1b368f5f8 100644 --- a/internal/test/e2e/autosdk/traces.json +++ b/internal/test/e2e/autosdk/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/databasesql/traces.json b/internal/test/e2e/databasesql/traces.json index 7dfaf6ac4..706cb250f 100644 --- a/internal/test/e2e/databasesql/traces.json +++ b/internal/test/e2e/databasesql/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/gin/traces.json b/internal/test/e2e/gin/traces.json index 0bfe63f9b..c668e79b2 100644 --- a/internal/test/e2e/gin/traces.json +++ b/internal/test/e2e/gin/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/grpc/traces.json b/internal/test/e2e/grpc/traces.json index 04313eaad..b41a479ce 100644 --- a/internal/test/e2e/grpc/traces.json +++ b/internal/test/e2e/grpc/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/kafka-go/traces.json b/internal/test/e2e/kafka-go/traces.json index f8b21d9de..ea3c2fd00 100644 --- a/internal/test/e2e/kafka-go/traces.json +++ b/internal/test/e2e/kafka-go/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/nethttp/traces.json b/internal/test/e2e/nethttp/traces.json index 6708d6f90..94303fd33 100644 --- a/internal/test/e2e/nethttp/traces.json +++ b/internal/test/e2e/nethttp/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/nethttp_custom/traces.json b/internal/test/e2e/nethttp_custom/traces.json index 4fe56817f..2f1edc259 100644 --- a/internal/test/e2e/nethttp_custom/traces.json +++ b/internal/test/e2e/nethttp_custom/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/e2e/otelglobal/traces.json b/internal/test/e2e/otelglobal/traces.json index c45b2231b..e2027d9e3 100644 --- a/internal/test/e2e/otelglobal/traces.json +++ b/internal/test/e2e/otelglobal/traces.json @@ -6,7 +6,7 @@ { "key": "process.runtime.description", "value": { - "stringValue": "go version 1.24.1 linux/amd64" + "stringValue": "go version 1.24.1 linux/VALID_ARCH" } }, { diff --git a/internal/test/test_helpers/utilities.sh b/internal/test/test_helpers/utilities.sh index 348325c8e..eff8f8598 100644 --- a/internal/test/test_helpers/utilities.sh +++ b/internal/test/test_helpers/utilities.sh @@ -147,13 +147,12 @@ redact_json() { | .resourceSpans[].scopeSpans[].spans[].parentSpanId|= (if . // "" | test("^[A-Fa-f0-9]{16}$") then "xxxxx" else (. + "") end) - | .resourceSpans[].scopeSpans[].spans[].attributes[]? |= if + | .resourceSpans[].scopeSpans[].spans[].attributes[]? |= if (.key == "network.peer.port") then .value.intValue |= (if . // "" | test("^[1-9][0-9]{0,4}$") then "xxxxx" else (. + "") end) else . end - | .resourceSpans[].scopeSpans[].spans[].events[]?.attributes[]? |= if - (.key == "exception.stacktrace") + | .resourceSpans[].scopeSpans[].spans[].events[]?.attributes[]? |= if then .value.stringValue |= "xxxxx" else @@ -161,6 +160,12 @@ redact_json() { end | .resourceSpans[].scopeSpans|=sort_by(.scope.name) | .resourceSpans[].scopeSpans[].spans|=sort_by(.kind) + | .resourceSpans[].resource.attributes[]? |= if + (.key == "process.runtime.description") then + .value.stringValue |= sub("amd64|arm64"; "VALID_ARCH") + else + . + end ' > ${BATS_TEST_DIRNAME}/traces.json } From 37abd61f1d6b6d2907e5abd176dcb73442edf81c Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Mon, 10 Mar 2025 23:21:54 +0200 Subject: [PATCH 6/6] fix redact --- internal/test/test_helpers/utilities.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/test/test_helpers/utilities.sh b/internal/test/test_helpers/utilities.sh index eff8f8598..2dbcafe29 100644 --- a/internal/test/test_helpers/utilities.sh +++ b/internal/test/test_helpers/utilities.sh @@ -147,12 +147,13 @@ redact_json() { | .resourceSpans[].scopeSpans[].spans[].parentSpanId|= (if . // "" | test("^[A-Fa-f0-9]{16}$") then "xxxxx" else (. + "") end) - | .resourceSpans[].scopeSpans[].spans[].attributes[]? |= if + | .resourceSpans[].scopeSpans[].spans[].attributes[]? |= if (.key == "network.peer.port") then .value.intValue |= (if . // "" | test("^[1-9][0-9]{0,4}$") then "xxxxx" else (. + "") end) else . end - | .resourceSpans[].scopeSpans[].spans[].events[]?.attributes[]? |= if + | .resourceSpans[].scopeSpans[].spans[].events[]?.attributes[]? |= if + (.key == "exception.stacktrace") then .value.stringValue |= "xxxxx" else @@ -160,7 +161,7 @@ redact_json() { end | .resourceSpans[].scopeSpans|=sort_by(.scope.name) | .resourceSpans[].scopeSpans[].spans|=sort_by(.kind) - | .resourceSpans[].resource.attributes[]? |= if + | .resourceSpans[].resource.attributes[]? |= if (.key == "process.runtime.description") then .value.stringValue |= sub("amd64|arm64"; "VALID_ARCH") else