Parcourir la source

Merge pull request #46663 from akerouanton/ci-otel-windows

ci: Setup otel tracing for windows integration tests
Sebastiaan van Stijn il y a 1 an
Parent
commit
ed1a61dcb7
2 fichiers modifiés avec 18 ajouts et 0 suppressions
  1. 2 0
      .github/actions/setup-tracing/action.yml
  2. 16 0
      .github/workflows/.windows.yml

+ 2 - 0
.github/actions/setup-tracing/action.yml

@@ -6,6 +6,8 @@ runs:
   steps:
   steps:
     - run: |
     - run: |
         set -e
         set -e
+        # Jaeger is set up on Windows through an inline run step. If you update Jaeger here, don't forget to update
+        # the version set in .github/workflows/.windows.yml.
         docker run -d --net=host --name jaeger -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:1.46
         docker run -d --net=host --name jaeger -e COLLECTOR_OTLP_ENABLED=true jaegertracing/all-in-one:1.46
         docker0_ip="$(ip -f inet addr show docker0 | grep -Po 'inet \K[\d.]+')"
         docker0_ip="$(ip -f inet addr show docker0 | grep -Po 'inet \K[\d.]+')"
         echo "OTEL_EXPORTER_OTLP_ENDPOINT=http://${docker0_ip}:4318" >> "${GITHUB_ENV}"
         echo "OTEL_EXPORTER_OTLP_ENDPOINT=http://${docker0_ip}:4318" >> "${GITHUB_ENV}"

+ 16 - 0
.github/workflows/.windows.yml

@@ -281,6 +281,15 @@ jobs:
         uses: actions/checkout@v3
         uses: actions/checkout@v3
         with:
         with:
           path: ${{ env.GOPATH }}/src/github.com/docker/docker
           path: ${{ env.GOPATH }}/src/github.com/docker/docker
+      -
+        run: |
+          # Jaeger is set up on Linux through the setup-tracing action. If you update Jaeger here, don't forget to
+          # update the version set in .github/actions/setup-tracing/action.yml.
+          Invoke-WebRequest -Uri "https://github.com/jaegertracing/jaeger/releases/download/v1.46.0/jaeger-1.46.0-windows-amd64.tar.gz" -OutFile ".\jaeger-1.46.0-windows-amd64.tar.gz"
+          tar -zxvf ".\jaeger-1.46.0-windows-amd64.tar.gz"
+          Start-Process '.\jaeger-1.46.0-windows-amd64\jaeger-all-in-one.exe'
+          echo "OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
+        shell: pwsh
       -
       -
         name: Env
         name: Env
         run: |
         run: |
@@ -479,6 +488,13 @@ jobs:
               Sort-Object @{Expression="TimeCreated";Descending=$false} |
               Sort-Object @{Expression="TimeCreated";Descending=$false} |
               ForEach-Object {"$($_.TimeCreated.ToUniversalTime().ToString("o")) [$($_.LevelDisplayName)] $($_.Message)"} |
               ForEach-Object {"$($_.TimeCreated.ToUniversalTime().ToString("o")) [$($_.LevelDisplayName)] $($_.Message)"} |
               Tee-Object -file ".\bundles\daemon.log"
               Tee-Object -file ".\bundles\daemon.log"
+      -
+        name: Download Jaeger traces
+        if: always()
+        run: |
+          Invoke-WebRequest `
+            -Uri "http://127.0.0.1:16686/api/traces?service=integration-test-client" `
+            -OutFile ".\bundles\jaeger-trace.json"
       -
       -
         name: Upload reports
         name: Upload reports
         if: always()
         if: always()