Skip to main content

Overview

OpenClaw is a self-hosted AI messaging gateway that bridges chat platforms (WhatsApp, Telegram, Discord, Slack, iMessage, etc.) to AI agents. There are two ways to get OpenClaw traces into TraceCtrl. Pick one: The tracectrl CLI installs and configures the plugin into your local OpenClaw install.
1

Install the plugin

This copies the plugin to ~/.openclaw/extensions/tracectrl, runs npm install and npm run build, then enables it in ~/.openclaw/openclaw.json. Pass --path /custom/openclaw if your OpenClaw root is elsewhere, and --endpoint http://host:4318 to override the collector URL.
2

Restart the gateway

3

Verify

The doctor command checks both that the plugin is installed and that it is enabled in openclaw.json.
The resulting openclaw.json block looks like this:

Plugin config options

What the plugin captures

The plugin also flags dangerous tools (bash/shell/exec), dangerous commands (rm -rf, sudo, reverse shells, piped curl), sensitive file access (.env, private keys, /etc/passwd), and prompt-injection patterns. Findings are recorded under tracectrl.security.* span attributes and counted by the tracectrl.security.events metric.

Alternative: built-in diagnostics-otel

If you can’t install the TraceCtrl plugin, OpenClaw ships its own OTLP exporter. Spans are shallower but the wiring is the same.
1

Enable the diagnostics-otel plugin

2

Configure OTEL export

Add to ~/.openclaw/openclaw.json:
OpenClaw exports via OTLP/HTTP (port 4318), not gRPC (4317).
3

Restart and verify

What diagnostics-otel captures

Protocol notes

  • OpenClaw’s built-in exporter supports OTLP/HTTP (protobuf) only — gRPC is not supported.
  • The TraceCtrl plugin supports both http and grpc via its protocol config option.
  • The endpoint should be the HTTP port (:4318), not gRPC (:4317), unless you’ve explicitly enabled gRPC ingest.
  • TraceCtrl’s engine currently consumes traces only. Metrics and logs sent to the collector are accepted but not surfaced in the dashboard.

Environment variables

Both paths honour the standard OTEL environment variables, which override the JSON config:

Reference