OpenClaw
Export OpenClaw agent runs, model calls, tools, token usage, cost, metrics, and logs to telemetry.dev over OTLP.
OpenClaw exports traces, metrics, and logs through its official diagnostics-otel plugin. Install the plugin, point it at telemetry.dev in your OpenClaw config, and each agent run appears as a trace with its model calls, tool calls, token usage, and cost.
By default OpenClaw sends no prompt, response, or tool content: spans carry sizes, names, and IDs only. Content is a single opt-in setting; see What leaves your machine.
Set up
Create an API key
Create a project at telemetry.dev and copy its API key. Keys start with td_live_.
Install the plugin
openclaw plugins install @openclaw/diagnostics-otelConfigure the exporter
Add the plugin and exporter settings to ~/.openclaw/openclaw.json:
{
plugins: {
allow: ["diagnostics-otel"],
entries: { "diagnostics-otel": { enabled: true } },
},
diagnostics: {
enabled: true,
otel: {
enabled: true,
endpoint: "https://ingest.telemetry.dev",
protocol: "http/protobuf",
serviceName: "openclaw-gateway",
headers: { Authorization: "Bearer td_live_..." },
},
},
}OpenClaw appends /v1/traces, /v1/metrics, and /v1/logs to the endpoint. Traces and metrics are on by default; add logs: true inside diagnostics.otel to also export Gateway logs.
Restart the Gateway
Restart the Gateway so it loads the plugin. After that, changes to diagnostics.otel apply without a restart.
Check that data arrives
Run an agent turn through the Gateway, then open the trace explorer. Metrics appear under Metric series on the project Overview after the first export.
openclaw doctor and openclaw status --all show whether the exporter is running and whether its last export failed.
The Gateway exports every run it executes, and openclaw agent --local exports from the CLI process. openclaw agent exec doesn’t start the exporter, so its runs send nothing.
What is recorded
The plugin sends spans for agent runs, harness lifecycle, model calls, tool executions, and exec. telemetry.dev reads the OpenTelemetry GenAI attributes on them for provider, model, latency, tokens, and cost.
OpenClaw reports usage twice: on each openclaw.model.call span, when the provider returns usage, and on a run-level openclaw.model.usage accounting span. telemetry.dev counts each run once when it adds up a trace. It uses the per-call values and falls back to the accounting span for any usage or cost the calls don’t report.
OpenClaw also exports metrics for token usage, cost, run duration, message flow, queues, sessions, and tool execution. Logs are off unless you set logs: true.
A run is usually one trace. A Gateway request that carries a W3C traceparent continues the caller’s trace, and nested or delegated runs can share a parent trace.
What leaves your machine
Without captureContent, OpenClaw sends no prompt text, response text, tool inputs, tool outputs, system prompts, or session keys. Spans carry bounded values such as channel, provider, model, error category, hashed request IDs, prompt sizes, and token counts. With logs: true, log records keep their severity and sanitized attributes, but not the message body.
To export content, set captureContent: true inside diagnostics.otel. OpenClaw then sends redacted, length-bounded prompts, responses, tool inputs and outputs, tool definitions, and log message bodies. It still excludes system prompts and thinking blocks.
Choose an environment
OpenClaw doesn’t set deployment.environment.name, so its data lands in the project’s default environment. To pick one, set this variable for the Gateway process:
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=development"
OpenClaw’s default resource detectors read this variable for traces and metrics. If you use an environment-scoped telemetry.dev API key, the attribute must match the key’s environment, or telemetry.dev rejects the request.
Limitations
OpenClaw’s spans don’t include a session key, session ID, or gen_ai.conversation.id, so telemetry.dev can’t group separate runs into one conversation.
For every exporter setting, see OpenClaw’s OpenTelemetry configuration and privacy pages.