Skip to main content

OpenClaw

OpenClaw is an observability agent built for LLM applications. It collects traces, metrics, and logs from your AI agents and services, then pushes them to a backend over the OpenTelemetry (OTLP) protocol. Casdoor can act as that backend, storing each signal as an Entry and rendering traces in a structured viewer.

How it works

OpenClaw runs alongside your application and instruments outbound LLM calls, tool invocations, and any other spans you configure. At collection intervals it serializes these as OTLP payloads and sends them to Casdoor's ingest endpoints:

SignalEndpoint
TracesPOST /api/v1/traces
MetricsPOST /api/v1/metrics
LogsPOST /api/v1/logs

All three expect Content-Type: application/x-protobuf. Casdoor stores each payload as an Entry and tags it with the sender's IP and User-Agent.

Setting up in Casdoor

1. Create a Log provider

  1. Go to ProvidersAdd.
  2. Set Category to Log and Type to Agent (OpenClaw).
  3. In the Host field, enter the IP address of the machine running the OpenClaw agent. Leave it empty to accept from any IP.
  4. (Optional) In the Storage provider field, pick which Storage provider should hold the raw session transcripts (see Raw session transcripts). Leave it empty to let Casdoor choose automatically.
  5. Save. Casdoor is now ready to receive data.

The Host field is an IP allowlist for this provider. Requests from any other address are rejected with 403 Forbidden, which prevents unauthorized agents from writing entries into your organization.

2. Configure OpenClaw

Point OpenClaw at your Casdoor instance using the OTLP HTTP exporter. The exact configuration depends on your OpenClaw version, but the core settings are:

exporters:
otlphttp:
endpoint: https://your-casdoor.com
headers:
Content-Type: application/x-protobuf

Refer to the OpenClaw documentation for agent-specific options such as sampling rates, batch sizes, and which signals to enable.

Viewing collected data

Once data is flowing, navigate to Entries in the Casdoor sidebar. Each incoming OTLP payload produces one Entry.

  • Trace entries render as a span tree in the built-in EntryMessageViewer, showing timing, attributes, and status for each span.
  • Metrics and log entries store the raw OTLP JSON in the Message field, which you can inspect directly or export for use in other tools.

Entries are scoped to an organization, so data from different teams or environments can be separated by placing them under different organizations with their own Log providers.

Raw session transcripts

Beyond the parsed trace view, Casdoor can keep the raw JSONL transcript of each OpenClaw session—the exact line-delimited log the agent produced. This is useful when you need the unmodified record for debugging, auditing, or replay.

Where transcripts are stored

When the OpenClaw provider syncs a session, Casdoor uploads that session's .jsonl file to a Storage provider and records it as a resource. It picks the target storage as follows:

  1. If you set the Storage provider field on the Log provider, that provider is used (it must be an enabled Storage provider in the same organization).
  2. Otherwise, Casdoor uses the first enabled Storage provider in the organization.
  3. If none exists, Casdoor automatically creates a default local Storage provider named openclaw-transcript-storage.

Re-syncing a session overwrites its stored transcript rather than creating duplicates.

Viewing a transcript

Open an OpenClaw session in the graph viewer. When a raw transcript is available, a Raw JSONL button appears in the viewer's toolbar; clicking it opens the transcript page for that session.

The viewer streams a preview of the file rather than the whole thing—up to 2 MB. For larger transcripts the response is marked as truncated so you know more content exists in the stored file. Behind the UI, the preview is served by:

GET /api/get-openclaw-session-transcript?id=<owner>/<session-name>

which returns the file name, total size, the number of bytes loaded, a truncated flag, and the transcript content.

Connecting to Casdoor agents

If you register your AI agents in Casdoor's Agents section, you can associate telemetry entries with the agent that produced them. The Agent record stores the agent's endpoint URL and bearer token, giving you a single place to correlate identity with observability data.

Next steps

  • Entries — understand entry types and the trace viewer
  • Log providers — full reference for the Agent (OpenClaw) provider
  • Agents — register AI agent endpoints in Casdoor