Skip to content

fix(diagnostics): honor signal-specific OTLP protocols - #119708

Merged
vincentkoc merged 2 commits into
mainfrom
fix/otel-signal-protocol-20260805
Aug 5, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/otel-signal-protocol-20260805

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Closes #119703

What Problem This Solves

Operators using standard signal-specific OTLP protocol environment variables
could lose otherwise supported traces, metrics, or logs because the diagnostics
OpenTelemetry plugin applied only the shared protocol value and aborted every
signal together.

The same global gate could reject traces and metrics owned by a preloaded
OpenTelemetry SDK, and logsExporter: "both" lost stdout output when only the
OTLP log protocol was unsupported.

Why This Change Was Made

The plugin now resolves protocol independently for each plugin-owned signal:
explicit OpenClaw config, then the nonblank signal-specific environment value,
then the nonblank shared environment value, then http/protobuf.

Unsupported protocols disable only that plugin-owned OTLP exporter. Supported
siblings continue, preloaded trace and metric SDKs retain transport ownership,
and the stdout branch of combined log export stays active. Startup and failure
events describe the exporters that actually started.

Docker Compose and scripts/docker/setup.sh now forward and persist all three
signal-specific protocol variables, so the documented deployment path reaches
the plugin behavior.

This does not add gRPC or HTTP/JSON transport support. The bundled exporters
remain explicit OTLP/HTTP protobuf exporters.

User Impact

Operators can use OTEL_EXPORTER_OTLP_TRACES_PROTOCOL,
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL, and
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL with the precedence defined by the stable
OTLP exporter specification. One unsupported signal no longer suppresses
supported siblings or stdout diagnostics, including in Docker deployments.

Evidence

  • Final rebased head: 5b8822f2a7263d06a0f44b0896c63c31e22d147d, based on origin/main 7b8bba26c9539eb631a56ea65c2ff22771b2d0db.
  • git range-diff e9e6ef3edbf22274eb79d41a1e092e5ce8f59e9f..84138dd35cc96865061b245be56032d8f90fed83 origin/main..HEAD: both commits remain patch-identical after the unrelated QA cleanup landed on main.
  • The complete binary diff hash is unchanged across the final rebase: 3aa0cc6d4f0be61795b3241d580b816af272d6fbac1b92600074629135d40432. The focused tests, live smoke, and autoreview below therefore cover the same patch bytes; exact-head static and hosted proof were rerun.
  • TMPDIR=/tmp node scripts/run-vitest.mjs src/docker-setup.e2e.test.ts extensions/diagnostics-otel/src/service.test.ts extensions/diagnostics-otel/src/service.otlp-export.test.ts: Docker setup 41/41 passed; diagnostics protocol/service 232/232 passed.
  • node --import tsx test/e2e/qa-lab/runtime/qa-otel-smoke-runtime.ts --collector local --logs-exporter both: live loopback smoke passed with 5 spans, 6 metrics, one OTLP log, one stdout log, and one request for each OTLP signal.
  • Exact-head Compose render:
{
  "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL": "http/protobuf",
  "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "http/protobuf",
  "OTEL_EXPORTER_OTLP_LOGS_PROTOCOL": "http/protobuf"
}
  • bash -n scripts/docker/setup.sh, git diff --check origin/main...HEAD, and targeted oxfmt --check passed.
  • Fresh final-head P0-P2 autoreview is clean with no actionable findings: patch correct, confidence 0.94.
  • Installed dependency source checked directly: @opentelemetry/sdk-node 0.221.0 resolves each signal protocol variable before OTEL_EXPORTER_OTLP_PROTOCOL; the fixed *-otlp-proto exporters expose no protocol selector.
  • Stable contract checked: https://opentelemetry.io/docs/specs/otel/protocol/exporter/
  • Exact-head ClawSweeper review found no actionable defect. Its Docker, configuration-reference, setup-test, and redacted Compose-proof rank-up moves are implemented; its final move to wait for required checks is satisfied by 74 passed, 41 skipped, 0 failed, and 0 pending checks.
  • Maintainer compatibility-risk disposition: accepted. Existing signal-specific protocol variables now take effect under the documented standard precedence, and an unsupported value disables only its plugin-owned exporter. This is the intended repair; it adds no persisted config or storage migration.
  • Production delta: +113/-55. Test delta: +308/-12. Docs delta: +13/-8. Production growth implements the per-signal dependency contract and Docker delivery boundary.

@vincentkoc vincentkoc self-assigned this Aug 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: diagnostics-otel Extension: diagnostics-otel docker Docker and sandbox tooling size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the fix/otel-signal-protocol-20260805 branch from 322fbae to a46e02c Compare August 5, 2026 20:02
@vincentkoc
vincentkoc marked this pull request as ready for review August 5, 2026 20:02
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head a46e02cfe57c6b992494bb0926e5f4885e0e9f17.

The branch is rebased onto merged lifecycle PR #119705. Focused tests pass 232/232, live local OTLP smoke passes with all three signal requests and stdout preserved, formatting/docs guards pass, and fresh exact-head P0-P2 autoreview is clean.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head a46e02cfe57c6b992494bb0926e5f4885e0e9f17.

The previous command collided with an older apply lease, which expired at 2026-08-05T20:18:03Z without publishing a durable review. Exact-head CI is now fully green: 69 successful, 39 skipped, zero failing or pending.

The branch is rebased onto merged lifecycle PR #119705. Focused tests pass 232/232, live local OTLP smoke passes with all three signal requests and stdout preserved, formatting/docs guards pass, and fresh exact-head P0-P2 autoreview is clean.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 5:31 PM ET / 21:31 UTC.

ClawSweeper review

What this changes

The PR resolves OTLP protocol settings independently for trace, metric, and log exporters, and forwards the three signal-specific variables through Docker setup.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking patch defect was found. This member-authored, maintainer-labeled PR should remain open for normal exact-head CI completion and maintainer handling; current main still has the reported global protocol gate.

Priority: P2
Reviewed head: 5b8822f2a7263d06a0f44b0896c63c31e22d147d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch cleanly repairs the exporter-owner boundary with focused sibling coverage; remaining hosted checks are a merge gate rather than a patch-quality defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes a redacted after-fix loopback collector smoke result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes a redacted after-fix loopback collector smoke result.
Evidence reviewed 5 items Current-main defect: Current main reads only the shared protocol and rejects all enabled OTLP signals before supported siblings or preloaded SDK ownership can proceed.
Owner-boundary repair: The PR resolves configuration, signal-specific environment, shared environment, and default protocol in order, then gates only plugin-owned exporters for each signal.
Sibling-path coverage: Focused tests cover mixed protocols, preloaded SDK ownership, blank environment values, stdout retention, and a real SDK loopback collector that receives only supported trace/log signals.
Findings None None.
Security None None.

How this fits together

OpenClaw’s diagnostics plugin turns internal diagnostic events into OTLP traces, metrics, and logs. Operator environment settings pass through Docker setup into the plugin, which decides which plugin-owned exporters can start.

flowchart LR
  A[Operator OTLP settings] --> B[Docker setup and Compose]
  B --> C[Diagnostics plugin]
  C --> D[Per-signal protocol decision]
  D --> E[Trace and metric exporters]
  D --> F[Log and stdout exporters]
  E --> G[OTLP collector]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - Existing deployments with a previously ignored signal-specific protocol variable will now honor it; an unsupported value disables only that signal’s OTLP exporter, as documented.
Agent review details

Security

None.

PR surface

Source +49, Tests +296, Docs +5, Other +9. Total +359 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 2 104 55 +49
Tests 3 308 12 +296
Docs 3 13 8 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 2 9 0 +9
Total 10 434 75 +359

Review metrics

Metric Value Why it matters
Signal-specific configuration 3 environment variables added Docker and documentation now expose per-signal protocol precedence, so existing deployment environments gain a compatibility-sensitive input path.
Production and test delta production +113/-55, tests +308/-12 The production growth implements a per-signal dependency and ownership boundary; focused regression coverage is correspondingly substantial.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/gateway/configuration-reference.md, serialized state: src/docker-setup.e2e.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119703
Summary: This PR is the candidate fix for the reported signal-specific OTLP protocol bug; the linked lifecycle and context-propagation PRs address distinct adjacent concerns.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the documented protocol contract (recommended)
    After exact-head CI succeeds, merge the change that makes pre-existing signal-specific OTLP variables effective while limiting unsupported values to their own exporter.

Technical review

Best possible solution:

Merge the plugin-owned per-signal resolver after the remaining exact-head checks complete, retaining the documented precedence and isolated exporter rejection.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main’s shared global gate is directly visible in source, and the PR’s focused tests provide a deterministic mixed-protocol setup covering the failure.

Is this the best way to solve the issue?

Yes. Resolving at the diagnostics plugin’s exporter-owner boundary preserves preloaded SDK ownership and stdout logging; retaining a global preflight would keep those sibling paths coupled.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7b8bba26c953.

Labels

Label changes:

  • add P2: This is a bounded diagnostics-export behavior fix for operators using signal-specific OpenTelemetry settings.
  • add merge-risk: 🚨 compatibility: The PR changes how existing signal-specific OTLP environment variables are interpreted in running and Docker-based deployments.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes a redacted after-fix loopback collector smoke result.

Label justifications:

  • P2: This is a bounded diagnostics-export behavior fix for operators using signal-specific OpenTelemetry settings.
  • merge-risk: 🚨 compatibility: The PR changes how existing signal-specific OTLP environment variables are interpreted in running and Docker-based deployments.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes a redacted after-fix loopback collector smoke result.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Authored this PR and the immediately preceding merged diagnostics lifecycle repair; repository history also shows concentrated work on the service. (role: recent area contributor; confidence: high; commits: 5b8822f2a726, 880dde979b5e; files: extensions/diagnostics-otel/src/service.ts, extensions/diagnostics-otel/src/service.test.ts)
  • steipete: Service history shows substantial prior contribution to the diagnostics OTLP surface, though the partial clone prevented a complete line-level history trace. (role: historical area contributor; confidence: medium; files: extensions/diagnostics-otel/src/service.ts)
  • Darren2030: Recent history connects this contributor to the signal-specific OTLP endpoint Docker and documentation path. (role: adjacent documentation contributor; confidence: medium; files: docs/gateway/opentelemetry.md, docker-compose.yml)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the remaining exact-head required checks to finish successfully before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head a46e02cfe57c6b992494bb0926e5f4885e0e9f17.

The prior exact review run 31043822814 was admitted for this head but GitHub rate-limited the ClawSweeper installation during its live-item check. Its recorded retry window was 2026-08-05T20:43:28Z; that window has now passed. Exact-head CI is fully green: 69 successful, 39 skipped, zero failing or pending.

The branch is rebased onto merged lifecycle PR #119705. Focused tests pass 232/232, live local OTLP smoke passes with all three signal requests and stdout preserved, formatting/docs guards pass, and fresh exact-head P0-P2 autoreview is clean.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 5, 2026
@vincentkoc
vincentkoc force-pushed the fix/otel-signal-protocol-20260805 branch from 4ac6441 to 84138dd Compare August 5, 2026 21:14
@vincentkoc
vincentkoc force-pushed the fix/otel-signal-protocol-20260805 branch from 84138dd to 5b8822f Compare August 5, 2026 21:25
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 5, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer decision: ACCEPT the documented compatibility change.

Exact head 5b8822f2a7263d06a0f44b0896c63c31e22d147d has fully green CI and an exact-head ClawSweeper review with no findings. The final Rank-up move to wait for checks is complete.

Existing signal-specific OTLP protocol variables should become effective under the OpenTelemetry precedence contract. Unsupported values remain isolated to only their own plugin-owned exporter.

@vincentkoc
vincentkoc merged commit 92b4757 into main Aug 5, 2026
137 checks passed
@vincentkoc
vincentkoc deleted the fix/otel-signal-protocol-20260805 branch August 5, 2026 21:39
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 5, 2026
…cope

* origin/main:
  perf(agents): isolate concurrency benchmark workers (openclaw#119749)
  fix(diagnostics): preserve OTEL startup failure (openclaw#119747)
  fix(agents): seed fresh session identity before transcript append (openclaw#119473)
  fix: steering reaches active runs across agent harnesses (openclaw#119594)
  fix(cli): report accurate filtered node totals (openclaw#119744)
  fix(skills): keep installed verdicts scoped to publisher (openclaw#119672)
  fix(diagnostics): honor signal-specific OTLP protocols (openclaw#119708)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
* fix(diagnostics): honor signal-specific OTLP protocols

* fix(docker): forward signal-specific OTLP protocols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: diagnostics-otel Extension: diagnostics-otel gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: diagnostics-otel ignores signal-specific OTLP protocol overrides

1 participant