Browse Source
fix(telemetry): use correct TopologyId field in integration test (#8714)
fix(telemetry): use correct TopologyId field in integration test (#8714)
* fix(telemetry): use correct TopologyId field in integration test The proto field was renamed from cluster_id to topology_id but the integration test was not updated, causing a compilation error. * ci: add telemetry integration test workflow Runs the telemetry integration test (server startup, protobuf marshaling, client send, metrics/stats/instances API checks) on changes to telemetry/ or weed/telemetry/. * fix(telemetry): improve error message specificity in integration test * fix(ci): pre-build telemetry server binary for integration test go run compiles the server on the fly, which exceeds the 15s startup timeout in CI. Build the binary first so the test starts instantly. * fix(telemetry): fix ClusterId references in server and CI build path - Replace ClusterId with TopologyId in server storage and API handler (same rename as the integration test fix) - Fix CI build: telemetry server has its own go.mod, so build from within its directory * ci(telemetry): add least-privilege permissions to workflow Scope the workflow token to read-only repository contents, matching the convention used in go.yml. * fix(telemetry): set TopologyId in client integration test The client only populates TopologyId when SetTopologyId has been called. The test was missing this call, causing the server to reject the request with 400 (missing required field). * fix(telemetry): delete clusterInfo metric on instance cleanup The cleanup loop removed all per-instance metrics except clusterInfo, leaking that label set after eviction.pull/8716/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 89 additions and 36 deletions
-
46.github/workflows/telemetry-integration.yml
-
1.gitignore
-
2telemetry/server/api/handlers.go
-
12telemetry/server/go.mod
-
25telemetry/server/go.sum
-
9telemetry/server/storage/prometheus.go
-
30telemetry/test/integration.go
@ -0,0 +1,46 @@ |
|||
name: Telemetry Integration Tests |
|||
|
|||
on: |
|||
push: |
|||
branches: [ master ] |
|||
paths: |
|||
- 'telemetry/**' |
|||
- 'weed/telemetry/**' |
|||
- '.github/workflows/telemetry-integration.yml' |
|||
pull_request: |
|||
branches: [ master ] |
|||
paths: |
|||
- 'telemetry/**' |
|||
- 'weed/telemetry/**' |
|||
- '.github/workflows/telemetry-integration.yml' |
|||
|
|||
permissions: |
|||
contents: read |
|||
|
|||
jobs: |
|||
telemetry-integration-test: |
|||
runs-on: ubuntu-latest |
|||
timeout-minutes: 5 |
|||
|
|||
steps: |
|||
- name: Checkout code |
|||
uses: actions/checkout@v6 |
|||
|
|||
- name: Set up Go |
|||
uses: actions/setup-go@v6 |
|||
with: |
|||
go-version-file: 'go.mod' |
|||
|
|||
- name: Build telemetry server |
|||
run: cd telemetry/server && go build -o telemetry-server . |
|||
|
|||
- name: Run telemetry integration test |
|||
run: go run telemetry/test/integration.go |
|||
|
|||
- name: Upload test logs on failure |
|||
if: failure() |
|||
uses: actions/upload-artifact@v7 |
|||
with: |
|||
name: telemetry-test-logs |
|||
path: telemetry-server-test.log |
|||
retention-days: 7 |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue