



























@@ -122,16 +122,54 @@ and setup-time config writes through `openclaw-gateway` with
122122123123The setup script accepts these optional environment variables:
124124125-| Variable | Purpose |
126-| ------------------------------ | --------------------------------------------------------------- |
127-| `OPENCLAW_IMAGE` | Use a remote image instead of building locally |
128-| `OPENCLAW_DOCKER_APT_PACKAGES` | Install extra apt packages during build (space-separated) |
129-| `OPENCLAW_EXTENSIONS` | Pre-install plugin deps at build time (space-separated names) |
130-| `OPENCLAW_EXTRA_MOUNTS` | Extra host bind mounts (comma-separated `source:target[:opts]`) |
131-| `OPENCLAW_HOME_VOLUME` | Persist `/home/node` in a named Docker volume |
132-| `OPENCLAW_SANDBOX` | Opt in to sandbox bootstrap (`1`, `true`, `yes`, `on`) |
133-| `OPENCLAW_DOCKER_SOCKET` | Override Docker socket path |
134-| `OPENCLAW_DISABLE_BONJOUR` | Disable Bonjour/mDNS advertising (defaults to `1` for Docker) |
125+| Variable | Purpose |
126+| ------------------------------- | --------------------------------------------------------------- |
127+| `OPENCLAW_IMAGE` | Use a remote image instead of building locally |
128+| `OPENCLAW_DOCKER_APT_PACKAGES` | Install extra apt packages during build (space-separated) |
129+| `OPENCLAW_EXTENSIONS` | Pre-install plugin deps at build time (space-separated names) |
130+| `OPENCLAW_EXTRA_MOUNTS` | Extra host bind mounts (comma-separated `source:target[:opts]`) |
131+| `OPENCLAW_HOME_VOLUME` | Persist `/home/node` in a named Docker volume |
132+| `OPENCLAW_SANDBOX` | Opt in to sandbox bootstrap (`1`, `true`, `yes`, `on`) |
133+| `OPENCLAW_DOCKER_SOCKET` | Override Docker socket path |
134+| `OPENCLAW_DISABLE_BONJOUR` | Disable Bonjour/mDNS advertising (defaults to `1` for Docker) |
135+| `OTEL_EXPORTER_OTLP_ENDPOINT` | Shared OTLP/HTTP collector endpoint for OpenTelemetry export |
136+| `OTEL_EXPORTER_OTLP_*_ENDPOINT` | Signal-specific OTLP endpoints for traces, metrics, or logs |
137+| `OTEL_EXPORTER_OTLP_PROTOCOL` | OTLP protocol override. Only `http/protobuf` is supported today |
138+| `OTEL_SERVICE_NAME` | Service name used for OpenTelemetry resources |
139+| `OTEL_SEMCONV_STABILITY_OPT_IN` | Opt in to latest experimental GenAI semantic attributes |
140+| `OPENCLAW_OTEL_PRELOADED` | Skip starting a second OpenTelemetry SDK when one is preloaded |
141+142+### Observability
143+144+OpenTelemetry export is outbound from the Gateway container to your OTLP
145+collector. It does not require a published Docker port. If you build the image
146+locally and want the bundled OpenTelemetry exporter available inside the image,
147+include its runtime dependencies:
148+149+```bash
150+export OPENCLAW_EXTENSIONS="diagnostics-otel"
151+export OTEL_EXPORTER_OTLP_ENDPOINT="http://otel-collector:4318"
152+export OTEL_SERVICE_NAME="openclaw-gateway"
153+./scripts/docker/setup.sh
154+```
155+156+The official OpenClaw Docker release image includes `diagnostics-otel`
157+dependencies. To enable export, allow and enable the `diagnostics-otel` plugin
158+in config, then set `diagnostics.otel.enabled=true` or use the config example in
159+[OpenTelemetry export](/gateway/opentelemetry). Collector auth headers are
160+configured through `diagnostics.otel.headers`, not through Docker environment
161+variables.
162+163+Prometheus metrics use the already-published Gateway port. Enable the
164+`diagnostics-prometheus` plugin, then scrape:
165+166+```text
167+http://<gateway-host>:18789/api/diagnostics/prometheus
168+```
169+170+The route is protected by Gateway authentication. Do not expose a separate
171+public `/metrics` port or unauthenticated reverse-proxy path. See
172+[Prometheus metrics](/gateway/prometheus).
135173136174### Health checks
137175此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。