@sonechaochao

OpenClaw Exporter to Langfuse

OpenClaw exporter for reporting AI agent execution traces to Langfuse via OpenTelemetry

Current version
v0.1.4
code-pluginCommunitysource-linked

openclaw-exporter-to-langfuse

What This Plugin Does

openclaw-exporter-to-langfuse is an OpenClaw plugin that exports AI agent execution traces to Langfuse via the OpenTelemetry OTLP protocol.

Every time OpenClaw handles an agent request, this plugin captures the full execution chain — including agent invocations, LLM calls, tool executions, token usage, and prompt/response content — and sends them as structured traces to your Langfuse project. This gives you end-to-end visibility into how your agents behave in production.

How It Works

OpenClaw Runtime
    │
    ├─ enter_openclaw_system  (ENTRY span)
    │     └─ invoke_agent     (AGENT span)
    │           ├─ chat       (LLM span — prompt, response, token usage)
    │           └─ execute_tool (TOOL span — tool name, input/output)
    │
    └─ [hooks: gateway_start / session_start / session_end /
               message_received / message_sending / message_sent /
               llm_input / llm_output / before_message_write /
               before_tool_call / after_tool_call /
               before_agent_start / agent_end]
               │
               ▼
    LangfuseExporter
    (OTLPTraceExporter → BatchSpanProcessor)
               │
               ▼
    Langfuse  /api/public/otel/v1/traces

Reported Spans

Span namegen_ai.span.kindDescription
enter_openclaw_systemENTRYRequest entry point
invoke_agentAGENTAgent invocation
chatLLMLLM call (prompt, response, tokens)
execute_toolTOOLTool / function call
session_start / session_endSession lifecycle
gateway_start / gateway_stopGateway lifecycle

Configuration

Add the following to your openclaw.json to enable the plugin and configure it under plugins.entries.openclaw-exporter-to-langfuse.config:

OptionTypeDefaultDescription
endpointstring""Langfuse OTLP endpoint (e.g. https://<LANGFUSE_HOST>/api/public/otel/v1/traces)
headers.Authorizationstring""Langfuse Basic auth header (base64-encoded pk:sk)
serviceNamestring"openclaw-agent"Service name shown in Langfuse traces
tagsstring[][]Custom Langfuse tags on the root trace span
batchSizenumber10Spans to buffer before flushing
flushIntervalMsnumber5000Max ms to wait before flushing buffered spans
debugbooleanfalseEnable verbose debug logging
skillTaggingEnabledbooleanfalseDetect and emit skill:* tags on tool observations
skillsRootsstring[][]Explicit skill root directories (skips auto-detection)
enabledHooksstring[](all)Restrict which hooks are active

Minimal example with Langfuse Cloud:

{
  "plugins": {
    "entries": {
      "openclaw-exporter-to-langfuse": {
        "enabled": true,
        "hooks": {
          "allowConversationAccess": true
        },
        "config": {
          "endpoint": "https://<LANGFUSE_HOST>/api/public/otel/v1/traces",
          "headers": {
            "Authorization": "Basic <base64(pk:sk)>"
          },
          "serviceName": "my-openclaw-agent"
        }
      }
    }
  }
}

Alibaba Cloud Observability Integration

Supports delivering OpenClaw runtime data to Alibaba Cloud ClickHouse Agent-lens and the All-in-one-observe-suite platform, helping you comprehensively monitor and analyze the runtime status of your Agent applications.

CapabilityWhat You Can SeeTool
Trace → Agent-lensFull agent call-chain tree, LLM prompt/response, token usage, per-span latencyAgent-lens
Trace / Metric / Log → ClickHouseGateway QPS, error rates, system logs, resource metrics — query with AI NotebookAll-in-one-observe-suite

Installation: https://ck-langfuse-public.oss-cn-beijing.aliyuncs.com/openclaw-exporter-to-langfuse/INSTALLATION.md

Full setup guide: https://help.aliyun.com/clickhouse/user-guide/openclaw-observability


Open Source: https://github.com/aliyun/openclaw-exporter-to-langfuse

Source and release

Source repository

aliyun/openclaw-exporter-to-langfuse

Open repo

Source commit

3acc7992ee5ce6c241ea0d405fb9f3bd1f132da1

View commit

Install command

openclaw plugins install clawhub:openclaw-exporter-to-langfuse

Metadata

  • Package: openclaw-exporter-to-langfuse
  • Created: 2026/05/09
  • Updated: 2026/05/09
  • Executes code: Yes
  • Source tag: v0.1.4

Compatibility

  • Built with OpenClaw: 2026.4.26
  • Plugin API range: >=2026.4.24
  • Tags: latest
  • Files: 39