OpenClaw Telemetry Plugin

February 3, 2026 · View on GitHub

██╗  ██╗███╗   ██╗ ██████╗ ███████╗████████╗██╗ ██████╗
██║ ██╔╝████╗  ██║██╔═══██╗██╔════╝╚══██╔══╝██║██╔════╝
█████╔╝ ██╔██╗ ██║██║   ██║███████╗   ██║   ██║██║     
██╔═██╗ ██║╚██╗██║██║   ██║╚════██║   ██║   ██║██║     
██║  ██╗██║ ╚████║╚██████╔╝███████║   ██║   ██║╚██████╗
╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝ ╚══════╝   ╚═╝   ╚═╝ ╚═════╝

OpenClaw Telemetry Plugin

By Knostic

Observability for OpenClaw. Capture every tool call, LLM request, and agent session — with built-in redaction, tamper-proof hash chains, syslog/SIEM forwarding, and rate limiting. Drop it in and know exactly what your agents are doing.

Also check out:


OpenClaw Telemetry Plugin - TL;DR

Captures tool calls, LLM usage, agent lifecycle, and message events. Outputs to JSONL file and optionally to syslog for SIEM integration.

Quick Start

1. Install

openclaw plugins install ./openclaw-telemetry

Or copy manually:

cp -R ./openclaw-telemetry ~/.openclaw/extensions/telemetry

2. Configure

Via Control UI: Settings → Config → plugins.entries.telemetry

Or edit ~/.openclaw/config.json:

{
  "plugins": {
    "entries": {
      "telemetry": {
        "enabled": true,
        "config": {
          "enabled": true
        }
      }
    }
  }
}

3. Restart Gateway

openclaw gateway

Logs write to ~/.openclaw/logs/telemetry.jsonl by default.

Coming Soon

openclaw plugins install @openclaw/telemetry

Configuration

Core Options

OptionTypeDefaultDescription
enabledbooleanfalseEnable telemetry capture
filePathstring~/.openclaw/logs/telemetry.jsonlJSONL output file path

Syslog Output

OptionTypeDefaultDescription
syslog.enabledbooleanfalseEnable syslog output
syslog.hoststringrequiredSyslog server hostname
syslog.portnumber514Syslog server port
syslog.protocolstringudpTransport: udp, tcp, or tcp-tls
syslog.formatstringcefMessage format: cef or json
syslog.facilitynumber16Syslog facility (16 = local0)
syslog.appNamestringopenclawApp name in syslog messages

Sensitive Data Redaction

Automatically redacts sensitive data (API keys, tokens, passwords) from tool parameters before logging.

OptionTypeDefaultDescription
redact.enabledbooleanfalseEnable redaction
redact.patternsstring[](built-in)Regex patterns to match. Prefix with (?i) for case-insensitive
redact.replacementstring[REDACTED]Replacement text

Default patterns detect:

  • OpenAI keys (sk-...)
  • GitHub tokens (ghp_..., gho_...)
  • GitLab tokens (glpat-...)
  • Slack tokens (xox[baprs]-...)
  • AWS credentials
  • Bearer tokens
  • Common api_key, password, secret, token patterns

Event Integrity (Hash Chain)

Adds cryptographic hash chain to events for tamper detection. Each event includes prevHash and hash fields, forming a verifiable chain.

OptionTypeDefaultDescription
integrity.enabledbooleanfalseEnable hash chain
integrity.algorithmstringsha256Hash algorithm

Rate Limiting

Prevents runaway agents from flooding outputs. Uses token bucket algorithm.

OptionTypeDefaultDescription
rateLimit.enabledbooleanfalseEnable rate limiting
rateLimit.maxEventsPerSecondnumber100Sustained event rate
rateLimit.burstSizenumber200Burst capacity

Log Rotation

Rotates JSONL files to prevent unbounded growth.

OptionTypeDefaultDescription
rotate.enabledbooleanfalseEnable rotation
rotate.maxSizeBytesnumber10485760Max file size (10MB)
rotate.maxFilesnumber5Rotated files to keep
rotate.compressbooleantrueGzip rotated files

Example Configurations

Basic

{
  "plugins": {
    "telemetry": {
      "enabled": true
    }
  }
}

Enterprise (all security features)

{
  "plugins": {
    "telemetry": {
      "enabled": true,
      "redact": {
        "enabled": true
      },
      "integrity": {
        "enabled": true
      },
      "rateLimit": {
        "enabled": true,
        "maxEventsPerSecond": 50
      },
      "rotate": {
        "enabled": true,
        "maxSizeBytes": 52428800,
        "maxFiles": 10
      },
      "syslog": {
        "enabled": true,
        "host": "siem.company.com",
        "port": 6514,
        "protocol": "tcp-tls",
        "format": "cef"
      }
    }
  }
}

Custom Redaction Patterns

{
  "plugins": {
    "telemetry": {
      "enabled": true,
      "redact": {
        "enabled": true,
        "patterns": [
          "(?i)internal-secret-[a-z0-9]+",
          "COMPANY-[A-Z]{4}-[0-9]{8}"
        ],
        "replacement": "***"
      }
    }
  }
}

Events

EventDescription
tool.startTool invocation started
tool.endTool invocation completed (success/failure, duration)
message.inInbound message received
message.outOutbound message sent
llm.usageLLM API call (tokens, cost, duration)
agent.startAgent session started
agent.endAgent session completed

JSONL Format

Basic event:

{"type":"tool.start","toolName":"bash","params":{"cmd":"ls"},"sessionKey":"telegram:123","seq":1,"ts":1738517700000}

With integrity enabled:

{"type":"tool.start","toolName":"bash","params":{"cmd":"ls"},"seq":1,"ts":1738517700000,"prevHash":"0000000000000000000000000000000000000000000000000000000000000000","hash":"a1b2c3d4e5f6..."}

With redaction (before):

{"type":"tool.start","toolName":"bash","params":{"cmd":"curl -H 'Authorization: Bearer sk-abc123...'"}}

With redaction (after):

{"type":"tool.start","toolName":"bash","params":{"cmd":"curl -H 'Authorization: [REDACTED]'"}}

CEF Format (syslog)

CEF:0|OpenClaw|openclaw|1.0|1001|Tool Invocation Started|3|rt=1738517700000 cs1=telegram:123 cs1Label=sessionKey act=bash cs5=a1b2c3... cs5Label=hash cs6=0000... cs6Label=prevHash

Verifying Hash Chain Integrity

# Verify chain integrity with jq
jq -s '
  reduce .[] as $evt (
    {valid: true, prev: ("0" * 64)};
    if .valid and $evt.prevHash == .prev
    then {valid: true, prev: $evt.hash}
    else {valid: false, prev: .prev, broken_at: $evt.seq}
    end
  )
' ~/.openclaw/logs/telemetry.jsonl

Querying

# Follow live events
tail -f ~/.openclaw/logs/telemetry.jsonl | jq .

# Filter by event type
jq 'select(.type=="tool.end")' ~/.openclaw/logs/telemetry.jsonl

# Get LLM costs
jq 'select(.type=="llm.usage") | {model, costUsd}' ~/.openclaw/logs/telemetry.jsonl

# Correlate by session
jq 'select(.sessionKey=="telegram:123456")' ~/.openclaw/logs/telemetry.jsonl

# Find failed tool calls
jq 'select(.type=="tool.end" and .success==false)' ~/.openclaw/logs/telemetry.jsonl

Rotated Files

When rotation is enabled, files are named:

  • telemetry.jsonl - current file
  • telemetry.jsonl.1.gz - most recent rotated (compressed)
  • telemetry.jsonl.2.gz - older
  • ...up to maxFiles

To read compressed logs:

zcat ~/.openclaw/logs/telemetry.jsonl.1.gz | jq .

SIEM Integration

The file-based output works with log shippers:

  • Filebeat: Configure a filestream input pointing to the JSONL file
  • Fluentd: Use in_tail with JSON parser
  • Splunk Universal Forwarder: Monitor the file path

The syslog output connects directly to:

  • Splunk (syslog input)

  • QRadar (CEF supported natively)

  • ArcSight (CEF supported natively)

  • Elastic SIEM (via Logstash syslog input)

  • Any RFC 5424 compliant collector

  • License

Apache 2.0 — see LICENSE for details.