openclaw - ✅(Solved) Fix OpenClaw gateway env defaults to OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf; manual fix overwritten by regeneration [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77646Fetched 2026-05-06 06:23:30
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Author
Timeline (top)
commented ×1cross-referenced ×1mentioned ×1subscribed ×1

Fix Action

Fixed

PR fix notes

PR #77680: fix(gateway): default OTEL_EXPORTER_OTLP_PROTOCOL to http/json

Description (problem / solution / changelog)

Summary

Default OTEL_EXPORTER_OTLP_PROTOCOL to http/json in docker-compose.yml. JSON is the safer default for OTLP/HTTP collectors: most accept it, while http/protobuf is a binary optimization that requires explicit collector support. Operators pointing the gateway at JSON-only collectors (e.g. Quencher /v1/traces) currently get every span batch rejected with HTTP 415 and have no clean fix — the generated env file warns against editing it, and any manual override gets overwritten on regeneration.

Changes

  • docker-compose.yml: change the OTEL_EXPORTER_OTLP_PROTOCOL default from http/protobuf to http/json. The override path (${OTEL_EXPORTER_OTLP_PROTOCOL:-...}) is preserved, so anyone explicitly setting http/protobuf in .env keeps that behavior.

This was the only hard-coded http/protobuf env-default in the repo's generated env paths. scripts/docker/setup.sh already defaults it to empty and inherits whatever compose substitutes.

Testing

Searched for test assertions against the docker-compose default value — none found:

  • extensions/diagnostics-otel/src/service.test.ts only asserts protocol behavior inside the OTel exporter extension.
  • src/config/schema.help.quality.test.ts validates schema enum values for diagnostics.otel.protocol.
  • extensions/anthropic/cli-shared.test.ts only checks OTEL_EXPORTER_OTLP_PROTOCOL is in the clearEnv allowlist.
  • src/agents/cli-runner.spawn.test.ts exercises env-var passthrough, not defaults.
  • src/docker-setup.e2e.test.ts does not inspect compose contents.

No tests needed updating. Skipped full repo test suite per task scope.

Caveats

This PR addresses option 1 from the issue (change default). Options 2 (per-profile config override) and 3 (preserve operator edits) remain open for future work.

One thing worth noting for follow-up: the in-tree extensions/diagnostics-otel/src/service.ts exporter explicitly rejects anything other than http/protobuf (line 586) and the zod schema for diagnostics.otel.protocol only allows http/protobuf or grpc. This change does not affect the internal extension — it only changes the value injected into the container's process env, which is consumed by external OTel SDKs (Claude Code, etc.) that DO honor http/json. If anyone wants the in-tree extension to also support http/json, that's the larger work flagged as option 2/3.

Fixes openclaw/openclaw#77646

Changed files

  • docker-compose.yml (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

Problem

The OpenClaw gateway service-env file (e.g. ~/.openclaw-<profile>/service-env/ai.openclaw.<profile>.env) is generated with OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf. When pointed at an OTLP/HTTP collector that only accepts JSON (e.g. Quencher /v1/traces), every span batch is rejected with HTTP 415.

The file header explicitly warns: "Generated by OpenClaw. Do not edit while the gateway service is installed." This means a manual fix to http/json is overwritten any time the file is regenerated by openclaw install / profile updates / OpenClaw upgrades.

Repro (bering-sea wallstreet, 2026-05-04)

  1. OpenClaw gateway 2026.4.29 installed for profile wallstreet, pointed at Quencher.
  2. Quencher accepts only application/json on /v1/traces (returns 415 for application/x-protobuf).
  3. Generated env file contained: export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
  4. ~62% of /v1/traces requests returned 415 with user-agent OTel-OTLP-Exporter-JavaScript/0.215.0.
  5. Manually editing the env file to http/json and restarting the gateway resolved 415s immediately. Access log showed clean transition from 415 to 202 across the kickstart.

Suggested fix

Three options, increasing intrusiveness:

  1. Default to http/json in generated env files. Most OTLP/HTTP collectors accept JSON; protobuf is a binary optimization that requires the collector to support it. JSON is the safer default.
  2. Accept a per-profile override (e.g. otel.protocol field in openclaw.json or an install flag) so operators can pin the protocol without manual env-file editing.
  3. Preserve operator-modified env values during regeneration when the regenerator detects manual edits.

Acceptance criteria

  • OpenClaw gateway profiles pointed at JSON-only collectors do not need post-install env-file editing.
  • If protobuf is preferred (e.g. Tempo, Jaeger collectors that accept it), there is a documented way to pin that choice that survives openclaw install regeneration.
  • Env-file regeneration logs a warning if it would overwrite a non-default protocol setting.

Related

  • chrisslee/quencher#290 (server-side 415 fix)
  • chrisslee/quencher#291 (parent producer-side data-loss issue)
  • chrisslee/operae#62 (operae-side telemetry fix - parallel work)
  • chrisslee/quencher#293, #294 (flux-operae bootstrap consistency)

Notes

For Quencher-bound deployments, the operator-pinned contract is:

OTEL_EXPORTER_OTLP_ENDPOINT=<quencher-url>/v1/traces OTEL_EXPORTER_OTLP_PROTOCOL=http/json OTEL_EXPORTER_OTLP_HEADERS=X-Quencher-API-Key=<key> OTEL_SERVICE_NAME=<producer-service-name>

OpenClaw generated env currently violates the protocol line.

extent analysis

TL;DR

The OpenClaw gateway service-env file should be updated to use OTEL_EXPORTER_OTLP_PROTOCOL=http/json to match the expected protocol of the OTLP/HTTP collector.

Guidance

  • Verify that the OTLP/HTTP collector only accepts JSON by checking its documentation or testing with a tool like curl.
  • Consider setting a per-profile override for the protocol, such as an otel.protocol field in openclaw.json, to allow operators to pin the protocol without manual editing.
  • If manual editing is necessary, update the OTEL_EXPORTER_OTLP_PROTOCOL variable in the generated env file to http/json and restart the gateway service.
  • To prevent overwriting manual edits, consider preserving operator-modified env values during regeneration or logging a warning when a non-default protocol setting would be overwritten.

Example

No code snippet is provided as it is not necessary for this issue.

Notes

The current implementation of OpenClaw may not support all of the suggested fixes, and manual editing of the env file may be overwritten during regeneration. It is essential to test and verify any changes to ensure compatibility with the OTLP/HTTP collector.

Recommendation

Apply a workaround by manually editing the OTEL_EXPORTER_OTLP_PROTOCOL variable in the generated env file to http/json and restarting the gateway service, as this is the most straightforward solution to resolve the issue immediately.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix OpenClaw gateway env defaults to OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf; manual fix overwritten by regeneration [1 pull requests, 1 comments, 2 participants]