feat: add operator and node gateway lifecycle telemetry#986
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d8c6ac-3d44-4b96-adfe-1e8509594f79
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d8c6ac-3d44-4b96-adfe-1e8509594f79
|
Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 9:44 PM ET / July 14, 2026, 01:44 UTC. Summary Reproducibility: not applicable. This PR adds an observability capability rather than fixing a defined failing behavior. The relevant verification path is a real gateway connection observed through an external OTLP collector. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the bounded opt-in instrumentation, then capture redacted current-head collector evidence showing the lifecycle traces, all three metrics, and ordered structured state logs, and resolve or explain the failing test job before merge. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds an observability capability rather than fixing a defined failing behavior. The relevant verification path is a real gateway connection observed through an external OTLP collector. Is this the best way to solve the issue? Yes, the proposed ownership and data boundaries appear appropriate: instrumentation stays in the connection manager, uses shared diagnostics-only primitives, and exports through the existing opt-in tray pipeline. The remaining blocker is current-head runtime proof, not an identified alternative implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 77c42440376e. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d8c6ac-3d44-4b96-adfe-1e8509594f79
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d8c6ac-3d44-4b96-adfe-1e8509594f79
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23d8c6ac-3d44-4b96-adfe-1e8509594f79
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
When the Windows tray cannot establish or maintain its gateway connections, existing diagnostics do not clearly show whether the operator or Windows node is failing during local preparation, WebSocket transport, gateway handshake, authentication or pairing, reconnect, or readiness transitions.
Why This Change Was Made
Adds opt-in operator-to-gateway and node-to-gateway lifecycle traces, metrics, and allowlisted structured logs through the existing tray-owned OpenTelemetry exporter. Instrumentation remains observational, exports only finite operational states, and does not change connection lifecycle decisions or introduce OpenTelemetry SDK dependencies into shared libraries.
User Impact
Developers and operators with an OpenTelemetry endpoint configured can diagnose operator and Windows node connection timing, reconnect attempts, authentication or pairing failures, superseded local attempts, and ready/degraded state transitions. Telemetry remains disabled when no endpoint is configured.
Evidence
Change Type
Scope
winnodeValidation
.\build.ps1— passed; 5 projects built successfully.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore— 2,763 passed, 31 skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore— 1,709 passed, 0 failed.WindowsNodeClientTests.HandleResponse_TerminalError_EmitsFiniteFailureClassification— 5 passed, 0 failed after final code changes.OpenClaw.Connection.Tests— 9 passed, 0 failed after final code changes.Real Behavior Proof
openclaw.connection.attempts,openclaw.connection.attempt.duration, andopenclaw.connection.state.transitionsmetrics with role filtering.Yes/No/N/A): YesScreenshots
Operator-Gateway Connection
Security Impact
Yes/No): NoYes/No): NoYes/No): No; signals use the existing user-configured OTLP exporter.Yes/No): NoYes/No): Yes; opt-in export now includes finite operator and node gateway lifecycle states and durations.Yes, explain the risk and mitigation: exported fields are restricted to role, operation, outcome, coarse error category, and finite operator/node/overall states. Gateway URLs and IDs, device IDs, request IDs, credentials, raw errors, and diagnostic text are excluded.Compatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations