Deep Observability
Deep observability gives operators low-overhead runtime metrics plus gated diagnostic capture for short investigations. Use it to monitor the gateway over time, diagnose memory or processor pressure, and compare release builds without leaving expensive capture on by accident. This page covers the WednesdayAI app-side controls. For the shared Grafana, Prometheus, Loki, Tempo, Pyroscope, OTel, and Langfuse stack work, see Deep Observability Stack Handoff.Configuration
Edit~/.openclaw/openclaw.json, then restart the gateway.
Linux:
Enable cheap runtime metrics
diagnostics.otel.runtime.enabled defaults to false. Enable it only when diagnostics.otel.enabled and the OTLP metrics path are configured.
/proc/self/io counters when available.
Enable diagnostic capture
diagnostics.capture.enabled defaults to false, and diagnostics.capture.mode defaults to off. Capture methods reject requests while capture is disabled or off.
Use manual for operator-triggered captures:
always only during a burn-in or active investigation. In this app-side slice it is a capture policy marker and permission gate; it does not start continuous Pyroscope or eBPF profiling until the monitoring-stack scheduler is wired. Switch back to manual or off after the window.
schedule to document a planned profiling or capture window. The app stores the schedule value, but real Pyroscope SDK or eBPF scheduling is owned by the monitoring stack follow-up, not this app-side gate.
Capture methods and permissions
The gateway exposes these diagnostics methods:
Heap snapshots are written with
0600 permissions, and their parent directory is created with 0700 permissions. Diagnostic reports include an allow-listed subset of Node report data; environment variables, command line, stacks, module paths, shared object paths, prompt text, credentials, and config are omitted.
Release performance sweep
Run a dry sweep when you want the output shape without contacting the gateway:diagnostics.runtime.snapshot and, with --capture, calls diagnostics.capture.cpu and diagnostics.capture.report. It writes release-performance-sweep.json and release-performance-sweep.md when --output-dir is set.
Operating model
- Keep runtime metrics on when the OTel metrics pipeline is healthy.
- Keep diagnostic capture
offormanualduring stable operation. - Use
alwaysonly during initial characterization, launch week, or a regression hunt. - Use scheduled profiling in the monitoring stack for release windows once the Pyroscope or eBPF integration exists.
- Keep raw prompts, credentials, chat IDs, session keys, and user IDs out of metric labels.
Troubleshooting
Runtime metrics do not appear
Check that:diagnostics.otel.enabledis true.diagnostics.otel.metricsis not false.diagnostics.otel.runtime.enabledis true.- The OTel collector endpoint accepts OTLP metrics.
- The
diagnostics-otelextension is the copy actually loaded by the gateway.
Capture request returns disabled
Check thatdiagnostics.capture.enabled is true and diagnostics.capture.mode is not off, then restart the gateway.
Live release sweep cannot reach diagnostics methods
Check gateway auth and method availability. The sweep requiresdiagnostics.runtime.snapshot; --capture also requires diagnostics.capture.cpu and diagnostics.capture.report.
Stuck-session thresholds
Two keys control when a processing session is considered stuck:stuckSessionWarnMs— time without progress before a “stuck session” diagnostic is logged. Values outside 1 s to 24 h fall back to the default.stuckSessionAbortMs— silence-since-last-progress before a stuck processing session is force-aborted. Only fires when there is queued work (queueDepth > 0).
Diagnostics flags
Targeted debug logs without raising global verbosity, underdiagnostics.flags:
telegram.* matches telegram.http; * enables all). One-off override: OPENCLAW_DIAGNOSTICS=telegram.http,telegram.payload. Restart the gateway after changing flags.