IntegrationsOpenClaw

Trace OpenClaw with Langfuse

What is OpenClaw? OpenClaw is a free and open-source autonomous AI agent created by Peter Steinberger. It is model-agnostic, supporting Claude, GPT, DeepSeek, and other LLMs. It runs locally and is accessed through messaging platforms like Signal, Telegram, Discord, and WhatsApp. OpenClaw can execute tasks, write its own skills, and maintain long-term memory of user preferences.

What is Langfuse? Langfuse is an open-source AI engineering platform that helps teams trace LLM calls, monitor performance, and debug issues in their AI applications.

Why trace OpenClaw?

An autonomous agent makes a lot of decisions you never see: which model it called, what it reasoned about, which skills and tools it reached for, and how much each turn cost. Tracing surfaces all of it.

  • Understand agent behavior. Read the prompts, reasoning traces, and tool calls that OpenClaw makes under the hood.
  • Improve your agent. Spot where the agent gets confused so you can tweak skills, system prompts, and configurations.
  • Track costs. Monitor token usage and spend across models and sessions.

Set up tracing

The OpenClaw x Langfuse plugin (the "Langfuse Bridge") subscribes to OpenClaw's internal diagnostics bus and turns each conversation turn into a nested Langfuse trace, with separate observations for model calls, tool executions, and retrieval steps. Traces are grouped into Langfuse sessions and include token usage, cost, latency, and any errors. Install it, paste your Langfuse keys, and you're done β€” no proxy and no code changes.

Set up Langfuse

Sign up for Langfuse Cloud or self-host Langfuse. Create a project and copy your public and secret API keys from the project settings.

Install the plugin

Install the plugin from ClawHub:

openclaw plugins install clawhub:openclaw-x-langfuse-plugin

Configure the plugin

Enable the plugin in openclaw.json and provide your Langfuse credentials:

{
  "plugins": {
    "allow": ["langfuse-bridge", "...any-other-plugins-you-have..."],
    "entries": {
      "langfuse-bridge": {
        "enabled": true,
        "config": {
          "publicKey": "pk-lf-...",
          "secretKey": "sk-lf-...",
          "baseUrl": "https://cloud.langfuse.com"
        }
      }
    }
  }
}

baseUrl selects your Langfuse data region: πŸ‡ͺπŸ‡Ί EU https://cloud.langfuse.com, πŸ‡ΊπŸ‡Έ US https://us.cloud.langfuse.com, πŸ‡―πŸ‡΅ Japan https://jp.cloud.langfuse.com, βš•οΈ HIPAA https://hipaa.cloud.langfuse.com, or your own URL for a 🏠 local deployment (e.g. http://localhost:3000).

You can also supply the credentials through the LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, and LANGFUSE_BASE_URL environment variables instead of putting them in openclaw.json. If the keys are missing, the plugin logs a warning and keeps running β€” it never blocks the gateway.

Restart the gateway

Apply the configuration by restarting the OpenClaw gateway:

openclaw gateway restart

View traces in Langfuse

Run OpenClaw as usual. Open your Langfuse project to see traces grouped by session, where you can inspect each turn's model calls, tool and skill executions, token usage, costs, and any forwarded errors.

Did you know?

Already routing OpenClaw's LLM calls through OpenRouter? You can also capture traces without touching OpenClaw's config by connecting your Langfuse keys in OpenRouter settings to enable Broadcast. Note that this only traces the LLM calls routed through OpenRouter, not OpenClaw's tool and skill spans.

Learn more


Was this page helpful?

Last edited