> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> Enable OpenClaw's official diagnostics-otel plugin to ship agent runs, model calls with token usage, tool executions, message flow, and Gateway logs to Sazabi as searchable logs.

[All OpenClaw integration capabilities](https://docs.sazabi.com/catalogs/integrations/openclaw)

## About

Ship OpenClaw Gateway telemetry to Sazabi with `diagnostics-otel`, OpenClaw's official OpenTelemetry exporter plugin. It needs no code changes and sends over OTLP/HTTP protobuf:

* **Spans** for each agent run (`openclaw.run`, `openclaw.harness.run`), model call (`openclaw.model.call`, with `gen_ai.request.model` and `gen_ai.usage.*` token counts), tool execution (`openclaw.tool.execution`, with `gen_ai.tool.name`), and message flow (`openclaw.message.processed`, `openclaw.message.delivery`, `openclaw.webhook.*`). They carry `openclaw.channel`, `openclaw.provider`, `openclaw.model`, `openclaw.outcome`, and `openclaw.errorCategory`.
* **Log records** from the Gateway's `logging.file` log, with `openclaw.subsystem`, severity, code location, trace context, and structured attributes such as model fallback decisions.

The Gateway exports for every run it executes. One-shot `openclaw agent --local` runs export from the CLI process. `openclaw agent exec` runs export nothing.

> [!WARNING]
>
> `diagnostics.otel.captureContent` is one switch for all text. Set to `true`, it exports prompts, model responses, tool inputs and outputs, and log message bodies together; OpenClaw cannot send prompts without responses. The setup below leaves it `false`, so log records arrive with the body `log` and spans carry metadata only. Structured log attributes, such as a short `openclaw.errorPreview` on a failed model call, are still exported after OpenClaw's redaction.

## Prerequisites

* OpenClaw with the `openclaw plugins` and `openclaw config` commands
* Your Sazabi intake URL, shown above — open the log source and copy the **Intake URL** from its setup screen (the public key is embedded in the URL)

## Set up in the dashboard

**Step 1**

### Install and enable diagnostics-otel

Run these commands where the OpenClaw Gateway runs:

```bash title="Terminal" theme={"system"}
openclaw plugins install @openclaw/diagnostics-otel
openclaw plugins enable diagnostics-otel
```

Official OpenClaw container images already bundle `diagnostics-otel`; there, only the `enable` command is needed.

**Step 2**

### Point the exporter at Sazabi

Write the exporter settings into `~/.openclaw/openclaw.json`:

```bash title="Terminal" theme={"system"}
openclaw config set diagnostics.enabled true
openclaw config set diagnostics.otel.enabled true
openclaw config set diagnostics.otel.endpoint "<your intake URL>"
openclaw config set diagnostics.otel.protocol http/protobuf
openclaw config set diagnostics.otel.serviceName openclaw-gateway
openclaw config set diagnostics.otel.traces true
openclaw config set diagnostics.otel.logs true
openclaw config set diagnostics.otel.metrics false
openclaw config set diagnostics.otel.captureContent false
```

Replace `<your intake URL>` with the intake URL shown above, with no path. OpenClaw appends `/v1/traces` and `/v1/logs` itself. The public key is part of the URL, so no `headers` entry is needed.

OpenClaw exports no logs unless `diagnostics.otel.logs` is `true`. Metrics stay off because Sazabi would store each data point as a log row, and the spans already carry token counts.

**Step 3**

### Restart the Gateway

Changes under `diagnostics.otel` hot-reload in a running Gateway, but enabling a plugin takes effect on start. Restart once:

```bash title="Terminal" theme={"system"}
openclaw gateway restart
```

## Set up with the CLI

You can also register the OpenClaw log source with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create openclaw --mode manual
```

The command prints the intake URL for the new source — copy the whole URL and point OpenClaw at it using the configuration shown above. Run `sazabi log-sources get <log-source-id>` at any time to reprint the endpoint, or `sazabi log-sources list` to see every log source in the project.

## Verify

Restart the Gateway and send the agent one message through any channel. `openclaw status --all` shows the exporter state for traces and logs. Open the [Intake page](https://docs.sazabi.com/guides/instrument/intake.md) in the Sazabi dashboard and confirm logs from the **OpenClaw** source appear within a minute or two.

From the CLI, `sazabi logs ask "How many openclaw-gateway log lines arrived in the last 15 minutes, by span name?"` confirms rows are arriving, and `sazabi logs ask "Show failed OpenClaw tool executions in the last day"` lists tool spans with an error category.

## Troubleshooting

**Nothing arrives** — Confirm `openclaw plugins list` shows `diagnostics-otel` enabled, `openclaw config get diagnostics` has `enabled: true` at both levels, and `OTEL_SDK_DISABLED` is not `true` in the Gateway's environment. If `plugins.allow` is set, it must include `diagnostics-otel`.

**Spans arrive but no log records** — `diagnostics.otel.logs` is unset or `false`, or `diagnostics.otel.logsExporter` is `stdout`. Set `logs` to `true` and remove `logsExporter`.

**Every log body reads `log`** — Expected with `captureContent: false`; OpenClaw withholds the message text. Filter on `openclaw.subsystem`, severity, and attributes.

**Exporter failures in `openclaw status --all`** — Confirm the endpoint is the intake URL with no path and `protocol` is `http/protobuf`.

## Further reading

> [card] [OpenClaw OpenTelemetry export](https://docs.openclaw.ai/gateway/opentelemetry)
>
> OpenClaw's guide to the diagnostics-otel plugin, its settings, and its span
> catalog.

> [card] [Intake](https://docs.sazabi.com/guides/instrument/intake.md)
>
> See per-source ingestion volume and health.

> [card] [Log sources](https://docs.sazabi.com/catalogs/log-sources.md)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.