Repository navigation
feat(diagnostics-otel): migrate to OpenTelemetry 3 - #189667
roboclaw-bot wants to merge 2 commits into
Conversation
Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 26cfaf52-dd15-4d43-b780-6a2bda3812b0
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs changes before merge. What this changesThis PR migrates diagnostics-otel to OpenTelemetry SDK 3 while preserving existing exporter settings and Jaeger propagation. Example: Run with OTEL_PROPAGATORS=jaeger and baggage value "a b/ü".
Review scores
ProductKind: Maintenance · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this maintainer-authored migration has a concrete regression for existing SDK 2 preloads. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe diagnostics plugin converts Gateway diagnostic events into traces, metrics, and logs, using private providers or externally preloaded providers to send telemetry to collectors. flowchart LR
A[Gateway diagnostic events] --> B[Diagnostics plugin]
C[Config and environment] --> B
B --> D[Private SDK providers]
B --> E[Preloaded global providers]
D --> F[OTLP collector]
E --> F
Technical reviewBest possible solution: Complete the SDK 3 migration while preserving access to existing host-owned SDK 2 providers through the established preload boundary. Do we have a high-confidence way to reproduce the issue? The SDK 2 preload failure follows directly from the plugin's API upgrade, the unchanged host-provider lookup path, and upstream's minor-version compatibility check; no runtime reproduction was executed. Is this the best way to solve the issue? The migration is focused, and the Jaeger adapter and sampler configuration preserve contracts removed upstream, but changing the preload fixture to SDK 3 leaves existing SDK 2 interoperability broken. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ed79334f5b72. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +171, Tests +100, Docs +7, Config 0, Other +74. Total +352 across 21 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 31, 2026, 3:22 PM ET / 19:22 UTC. |
What Problem This Solves
Move the diagnostics exporter to the age-qualified OpenTelemetry SDK 3 without breaking existing propagation or collector settings.
User Impact
Configured trace, metric, and log exports, sampling and span limits, resource attributes, and generation-private flush/shutdown behavior are retained. Deprecated
OTEL_PROPAGATORS=jaegerstill reads and writesuber-trace-idanduberctx-*baggage; no cross-service header migration is forced.Why This Change Was Made
@opentelemetry/api;sdk-tracereplacessdk-trace-base. Follow the 3.x migration guide.packages/aiget development API 1.9.1 pins so Mistral's optional SDK 2 peers remain compatible, without new peer overrides or changes to public peer contracts.Versions and holds
@openclaw/aipublic peers. The inherited Mistral exporter ^0.220/0.223 peer warning remains; new OTel API peer violations are resolved.Evidence
pnpm test:extension diagnostics-otel: 13 files, 149 tests passed, 8m12s wrapper wall / 446.52s Vitest. Covers real OTLP receivers, propagation, resources, sampling, TLS, external ownership, and restart flush/shutdown.git diff --check; docs links (16,194 checked, zero broken).openclaw/ci-gate,security-fast, and security-sensitive review report success for2b57294febc1552db62d910dfa1bd0b77c09c891. No CI rerun, merge, or auto-merge was requested. Test-specific CI seconds were not collected.Cannot verify that test preparation is separate from managed Gateway artifacts; no checkout artifacts were rebuilt. The configured Blacksmith Testbox fallback was stopped after more than ten minutes of local source-capsule preparation, still ingit update-index --refresh, before remote allocation/run. No lease ID, Actions URL, or remote test result was produced. No provider fallback or guard bypass was used.1df551011c87ddab2b6e6edb316682cd8a9de1f2, including final source verification. It checked upstream contracts statically, not test execution/publication dates. Published head has the same source tree as the reviewed implementation commit.Requested and guided by @steipete.
Work sessions
Worked on by