Repository navigation
fix(diagnostics-otel): metrics and logs posted to the traces endpoint when the shared OTLP endpoint is signal-qualified - #101655
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 1:29 PM ET / 17:29 UTC. ClawSweeper reviewWhat this changesThe PR routes shared OTLP endpoints to each signal’s HTTP path while preserving explicit trace, metric, and log endpoint overrides verbatim. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessCurrent main still misroutes metrics and logs from a shared signal-qualified OTLP endpoint; this exact-head PR cleanly repairs that owner boundary with no actionable review finding. A member has explicitly accepted the bounded compatibility change, so it is ready for normal maintainer merge handling. Priority: P2 Review scores
Verification
How this fits togetherGateway diagnostics configuration and OTLP environment variables feed the diagnostics-OTEL plugin, which resolves exporter URLs before OpenTelemetry sends trace, metric, and log protobuf payloads to a collector. flowchart LR
A[Diagnostics settings] --> C[Diagnostics OTEL plugin]
B[OTLP environment variables] --> C
C --> D[Endpoint source decision]
D --> E[Per-signal exporter URLs]
E --> F[OTLP collector]
F --> G[Telemetry ingestion]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +175, Docs +13. Total +204 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the source-aware resolver after ordinary exact-head gates, retaining explicit per-signal endpoints as the documented compatibility path for collectors that intentionally use custom routes. Do we have a high-confidence way to reproduce the issue? Yes: current main’s shared resolver and three exporter call sites directly establish the misrouting path, and the PR’s loopback receiver proof exercises the repaired production exporter boundary. Is this the best way to solve the issue? Yes: separating shared endpoint routing from explicit signal-specific overrides at the diagnostics exporter boundary avoids duplicating URL policy in callers or transports. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 414616f58389. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
f540261 to
349ed1e
Compare
349ed1e to
91452b8
Compare
|
@clawsweeper re-review This addresses the review findings and brings the branch up-to-date with
Local run output:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
989285f to
7eefef1
Compare
|
Rebased onto the latest
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
7e24584 to
901b65b
Compare
|
Fixed the CI oxlint error in main().catch((err: unknown) => {
console.error(err);
process.exitCode = 1;
});Local verification: Rebased onto latest |
|
Re: @vincentkoc — ClawSweeper's compatibility label is about one specific behavior change; I'd like your explicit accept before merge. No code change is needed; this is the bot's "maintainer decision needed" item. What changes. A shared OTLP Why no shipped working config breaks.
Contract basis. Pinned This matches ClawSweeper's recommended option (accept standard OTLP per-signal routing for shared signal-qualified endpoints and merge). If you'd rather keep exact shared-URL reuse as the default, I'm happy to switch to an opt-in/warning design instead. Real-behavior proof is in the loopback repro at |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Keep shared endpoint routing signal-aware while preserving explicit signal-specific URLs exactly. Cover the resolver through mocked constructors and real OTLP/HTTP trace, metric, and log exporters. Co-authored-by: Darren2030 <[email protected]>
47b180d to
0db1121
Compare
|
@clawsweeper re-review Exact head: Latest rank-up moves are addressed:
Installed OpenTelemetry JS |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…cope * origin/main: (70 commits) fix(clickclack): preserve MIME extension for unnamed uploads (openclaw#119646) fix(memory): keep post-ready RPCs responsive (openclaw#119710) fix(browser): preserve locale, timezone, and device overrides (openclaw#119695) fix(agents): stop messaging dedupe from dropping final replies that quote a short tool send (openclaw#118178) test(agents): batch code mode budget proof (openclaw#119699) fix(memory): keep gateway RPCs responsive during startup (openclaw#119676) improve(ui): trail transient session status beside row actions (openclaw#119560) refactor(msteams): consolidate channel action target resolution (openclaw#119632) fix: tail context answers the current user message (openclaw#117364) fix(whatsapp): exercise descriptor-safe credential persistence (openclaw#119621) fix(diagnostics-otel): route OTLP endpoints by signal (openclaw#101655) refactor(skills): consolidate workshop transcript and record normalization (openclaw#119643) fix(video): harden DashScope task and media lifecycle (openclaw#117303) refactor(transcripts): consolidate persistence and export ownership (openclaw#119634) fix: preserve ClickClack discussion state contracts (openclaw#118851) fix(matrix): retire shared E2EE clients safely (openclaw#119570) refactor(cron): unify catch-up persistence and payload encoding (openclaw#119636) refactor(ui): centralize composer attachment and capability controls (openclaw#119650) refactor(daemon): consolidate managed service lifecycle ownership (openclaw#119647) fix(browser): honor explicit navigation timeouts across browser drivers (openclaw#119654) ...
Keep shared endpoint routing signal-aware while preserving explicit signal-specific URLs exactly. Cover the resolver through mocked constructors and real OTLP/HTTP trace, metric, and log exporters. Co-authored-by: Vincent Koc <[email protected]>
Closes #98886
What Problem This Solves
Fixes an issue where operators using one shared OTLP HTTP endpoint could send metrics and logs to the traces route when that endpoint already ended in
/v1/traces. Collectors then rejected the mismatched protobuf payload, so those signals never arrived.Why This Change Was Made
The root cause was loss of endpoint-source identity in
resolveSignalOtelUrl: shared and signal-specific endpoints were collapsed before routing, and any terminal/v1/{traces,metrics,logs}path was then preserved for every signal.The canonical fix stays at the diagnostics OTLP exporter boundary:
/v1/<signal>./v1/<signal>keeps the matching route and replaces that terminal signal for the other exporters.OTEL_EXPORTER_OTLP_*_ENDPOINTvalues are passed through verbatim.This matches the stable OTLP exporter contract and the installed OpenTelemetry JS
0.221.0implementation: the shared endpoint is a base, while signal-specific endpoints are used as supplied. The change does not absorb protocol, shutdown, recorder, or health work.User Impact
Traces, metrics, and logs now reach their canonical OTLP HTTP routes when a shared endpoint is configured, including hosted collector URLs such as
/api/public/otel/v1/traces. Operators who configure signal-specific endpoints keep exact URL control, including custom paths, query strings, and trailing slashes.Release-note context: this is a user-visible diagnostics routing fix. The behavior and upgrade note are documented in
docs/gateway/opentelemetry.md; no contributorCHANGELOG.mdentry is included.Evidence
0db11215280089981113f527cee017aa543082fa.223/223tests passed acrossservice.test.tsandservice.otlp-export.test.ts;git diff --check, targetedoxfmt, and branch autoreview passed with no accepted/actionable findings./api/public/otel/v1/traces; signal-specific endpoints were observed exactly as configured.aws, leasecbx_8c8770d483bb, runrun_26c824aa42b3matched changed-file and lockfile SHA-256 values, then passed223/223tests and formatting.run_da265682deb0passed conflict, env-var, max-lines, attribution, extension-boundary, dependency, format, Plugin SDK, deprecated API, plugin-boundary, and patch guards. Its only failure was the repository-wide dead-export scan on untouchedsrc/config/**.run_2f4eb562555areproduced the identical dead-export failure on base9ef94e4ef93c73c0d3331f1546128b1e95b6bfce, proving it is independent of this PR.pretty-mslink; a frozen reinstall then hit the unchanged base lockfile's missing@oxc-parser/[email protected]entry. Hosted exact-head CI passed, includingbuild-artifacts,check-lint, andopenclaw/ci-gate: https://github.com/openclaw/openclaw/actions/runs/31028619754.cbx_8c8770d483bbwas released, and the subsequent AWS lease list was empty.+27/-11(net+16), tests+187/-12(net+175), docs+13/-0.