Skip to content
telemetry.dev
Esc
navigateopen⌘Jpreview
On this page

OpenClaw

Export OpenClaw agent runs, model calls, tools, token usage, cost, metrics, and logs over OTLP.

OpenClaw’s official diagnostics-otel plugin exports OTLP/HTTP protobuf directly to telemetry.dev. Setup requires configuration rather than an application SDK or collector.

Set up the exporter

Create a telemetry.dev project and copy its API key. Install the plugin:

openclaw plugins install clawhub:@openclaw/diagnostics-otel

Add the exporter to your OpenClaw configuration:

{
  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 <your-api-key>" },
    },
  },
}

Restart the Gateway. Traces and metrics then appear in telemetry.dev. Add logs: true inside diagnostics.otel to export structured Gateway logs.

What it captures

The plugin emits harness and run spans around model calls and tool executions. telemetry.dev normalizes the OpenTelemetry GenAI attributes into provider, model, latency, token, and cost fields. OpenClaw also exports operation-duration, queue, session, and token metrics; logs are opt-in.

OpenClaw reports usage on model-call spans and on a run-level openclaw.model.usage accounting span. telemetry.dev deduplicates these records per run when computing trace totals: it uses complete per-call values and falls back to the accounting span for missing usage or cost fields.

Choose an environment

OpenClaw does not set deployment.environment.name, so records use the project’s default environment. To select an environment, set this variable on the Gateway process:

export OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production"

You can use an environment-scoped telemetry.dev API key with the matching resource attribute.

Content capture and privacy

OpenClaw does not put prompts, responses, or tool content on the wire by default. To export that content, set diagnostics.otel.captureContent: true.

OpenClaw excludes system prompts and thinking blocks even when content capture is enabled.

Trace and session limitations

A run is usually one trace. A Gateway request with a W3C traceparent continues its upstream trace, and nested or delegated runs can share a parent trace.

OpenClaw exports no session key, session ID, or gen_ai.conversation.id. telemetry.dev therefore cannot join separate traces into a conversation.

See the OpenClaw OpenTelemetry documentation for exporter settings. Open the trace explorer after a run completes.

Last updated on September 5, 2026

Was this page helpful?