Sub-phase 3.1 of ADR-0023 Phase 3 (telemetry sampler hot-reload)
Per the Mistral-produced phase plan validated 2026-05-05 (Q-037 in mistral-quirks.md). Wiring lands in 3.2 (config callback) and 3.3 (server invocation) — kept separate for clean rollback.
What ships
ReconfigureTracerProvider(ctx, oldTP) on pkg/telemetry/telemetry.go : builds new TracerProvider with current Setup sampler settings, swaps the global via otel.SetTracerProvider, gracefully shuts down the old one.
No-op when oldTP is nil (telemetry-disabled-at-startup → out of scope for Phase 3).
3 unit tests : nil no-op, global TP swap (with assert.Same verifying actual behavior), error-tolerance when old TP shutdown fails.
Verifier verdict (sub-agent review, applied)
Was: APPROVE_WITH_NITS. Two nits flagged + applied :
Removed dead assert.Equal(X, X) line that was structural sanity, not behavior.
Added file-level comment "MUST NOT parallelize — mutates otel global" to harden against future drift.
Now: APPROVE.
Test plan
go test -race ./pkg/telemetry/... passes
go vet ./... clean
Pre-commit hooks successful
Reviewer to verify ADR-0023 Phase 3 is correctly scoped (sub-phase 3.1 isolation)
## Sub-phase 3.1 of ADR-0023 Phase 3 (telemetry sampler hot-reload)
Per the Mistral-produced phase plan validated 2026-05-05 (Q-037 in mistral-quirks.md). Wiring lands in 3.2 (config callback) and 3.3 (server invocation) — kept separate for clean rollback.
## What ships
- `ReconfigureTracerProvider(ctx, oldTP)` on `pkg/telemetry/telemetry.go` : builds new TracerProvider with current `Setup` sampler settings, swaps the global via `otel.SetTracerProvider`, gracefully shuts down the old one.
- No-op when oldTP is nil (telemetry-disabled-at-startup → out of scope for Phase 3).
- 3 unit tests : nil no-op, global TP swap (with `assert.Same` verifying actual behavior), error-tolerance when old TP shutdown fails.
## Verifier verdict (sub-agent review, applied)
Was: APPROVE_WITH_NITS. Two nits flagged + applied :
- Removed dead `assert.Equal(X, X)` line that was structural sanity, not behavior.
- Added file-level comment "MUST NOT parallelize — mutates otel global" to harden against future drift.
Now: APPROVE.
## Test plan
- [x] `go test -race ./pkg/telemetry/...` passes
- [x] `go vet ./...` clean
- [x] Pre-commit hooks successful
- [ ] Reviewer to verify ADR-0023 Phase 3 is correctly scoped (sub-phase 3.1 isolation)
First sub-phase of ADR-0023 Phase 3 (telemetry sampler hot-reload), per
the Mistral-produced phase plan validated 2026-05-05 (Q-037 in
mistral-quirks.md).
This is the isolated telemetry-package change: adds ReconfigureTracerProvider
that builds a new TracerProvider with updated sampler settings, swaps the
global, and gracefully shuts down the old. No-op when oldTP is nil
(telemetry-disabled-at-startup is out of scope for Phase 3).
The wiring (config callback → server-level invocation) lands in sub-phases
3.2 and 3.3 — kept separate for clean rollback semantics.
Tests:
- 3 new tests in pkg/telemetry/telemetry_test.go covering nil no-op, the
global TP swap, and error-tolerance when old TP shutdown fails.
- go test -race ./pkg/telemetry/... passes.
Verifier verdict (skill-driven, mental run): APPROVE. Function is 17 lines,
single responsibility, defensive on nil; tests cover positive + invariant
+ tolerance.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Sub-phase 3.1 of ADR-0023 Phase 3 (telemetry sampler hot-reload)
Per the Mistral-produced phase plan validated 2026-05-05 (Q-037 in mistral-quirks.md). Wiring lands in 3.2 (config callback) and 3.3 (server invocation) — kept separate for clean rollback.
What ships
ReconfigureTracerProvider(ctx, oldTP)onpkg/telemetry/telemetry.go: builds new TracerProvider with currentSetupsampler settings, swaps the global viaotel.SetTracerProvider, gracefully shuts down the old one.assert.Sameverifying actual behavior), error-tolerance when old TP shutdown fails.Verifier verdict (sub-agent review, applied)
Was: APPROVE_WITH_NITS. Two nits flagged + applied :
assert.Equal(X, X)line that was structural sanity, not behavior.Now: APPROVE.
Test plan
go test -race ./pkg/telemetry/...passesgo vet ./...clean