Skip to main content
⚠️ Experimental: OpenClaw’s diagnostics-otel plugin is under active development. The instrumentation spec is stabilizing but may change. Follow the discussion at PR #11100 for the latest.
OpenClaw is an open-source AI agent framework that runs as a personal assistant or production copilot, handling tasks like code reviews, monitoring, incident response, and more. Its built-in diagnostics-otel plugin emits OpenTelemetry GenAI Semantic Conventions-compliant traces that LangWatch can ingest natively.

Setup

1

Get your LangWatch API Key

Go to app.langwatch.ai/authorize to create your account and project, then grab your API key.
2

Configure OpenClaw

Add the following to your ~/.openclaw/openclaw.json:
If you already have an openclaw.json, just merge the diagnostics and plugins sections into your existing config.
3

Restart the gateway

4

Test the integration

Send a message to your agent and check the LangWatch dashboard. Each agent turn produces a trace with the full execution tree.

What You Get

Each agent turn produces a span tree like this:
LLM spans are children of the run. Tool spans are children of the LLM call that invoked them. Each span includes:
  • Model info: which model was requested and which was used
  • Token usage: prompt tokens, completion tokens, cache read/write breakdown
  • Latency: duration of each LLM call and tool execution
  • Cost: calculated from token usage
  • Content: full input/output messages when captureContent is enabled

Content Capture

The captureContent flag controls whether message content is included in traces. When enabled, traces include:
  • gen_ai.input.messages, the full prompt sent to the model
  • gen_ai.output.messages, the model’s response
  • gen_ai.system_instructions, the system prompt
  • gen_ai.request.tools, tool definitions available to the model
  • Tool input/output on execution spans
When disabled, you still get the full trace structure, token counts, latency, and model metadata, just no message content. Useful if you want observability without logging sensitive conversations.

Configuration Reference

For high-volume deployments, consider reducing sampleRate to control costs. A rate of 0.1 samples 10% of traces.

GenAI Semantic Conventions

The plugin emits traces compliant with the OTEL GenAI semantic conventions: LLM spans use SPAN_KIND_CLIENT per the GenAI spec (outbound RPCs to model providers).
For more information, check out the OpenClaw documentation and the diagnostics-otel discussion.
Last modified on May 28, 2026