Skip to content

OpenClaw integration with Coralogix

Stream gateway sessions, token usage, costs, model runs, message flow, and webhook activity from OpenClaw directly into Coralogix. OpenClaw emits traces, metrics, and logs over OpenTelemetry (OTel) natively through the diagnostics-otel plugin—activate it in your config and data flows automatically.

Supported environments

  • Any environment where OpenClaw gateway runs

What you need

  • A Coralogix account with a Send-Your-Data API key. In Coralogix, navigate to Settings, then API Keys.
  • Your Coralogix OTLP endpoint: ingress.:443. Use the domain selector at the top of this page to select your region.
  • OpenClaw installed and running. See the OpenClaw getting started guide.

Set up

Configure

OpenClaw stores all configuration in ~/.openclaw/openclaw.json. Add the following two blocks to your existing config file—do not replace the file, as it contains your channels, auth, and agent settings.

Open ~/.openclaw/openclaw.json and merge in:

{
  "plugins": {
    "allow": ["diagnostics-otel"],
    "entries": {
      "diagnostics-otel": { "enabled": true }
    }
  },
  "diagnostics": {
    "enabled": true,
    "otel": {
      "enabled": true,
      "endpoint": "ingress.:443",
      "protocol": "http/protobuf",
      "serviceName": "openclaw-gateway",
      "traces": true,
      "metrics": true,
      "logs": false,
      "flushIntervalMs": 60000,
      "sampleRate": 1.0,
      "headers": {
        "Authorization": "Bearer <your-send-your-data-api-key>",
        "cx-application-name": "openclaw",
        "cx-subsystem-name": "openclaw-gateway"
      }
    }
  }
}

If your config already has a plugins block, add "diagnostics-otel" to the existing allow array and entries object rather than creating a second block.

Replace the following placeholders:
PlaceholderValue
<your-send-your-data-api-key>Your Send-Your-Data API key from Settings, then API Keys
cx-application-nameAny name to group data under in Coralogix (default: openclaw)
cx-subsystem-nameAny subsystem name for routing (default: openclaw-gateway)

Restart the gateway

openclaw gateway restart

OpenClaw now streams telemetry to Coralogix.

Validate the integration

After starting the gateway and running a session, confirm that data is flowing:

  1. In Coralogix, navigate to Metrics Explorer and search for openclaw. Metrics appear within one flush interval (default 60 seconds).
  2. Navigate to Explore, then Tracing and filter by service name openclaw-gateway.
  3. If you turned on log export, navigate to Logs and filter by application name openclaw and subsystem openclaw-gateway.

Configuration examples

Reduce the flush interval during testing

Add to the otel block in ~/.openclaw/openclaw.json:

"flushIntervalMs": 10000

Activate log export

Set logs to true in the otel block. Log export is off by default to keep volume manageable.

"logs": true

Reduce trace sampling

Lower the sampling rate to reduce trace volume in high-throughput environments:

"sampleRate": 0.5

This samples 50% of root spans. Child spans follow the root span's sampling decision.

Data reference

Metrics

All metrics appear in Metrics Explorer when you search openclaw. Filter by cx_subsystem_name = openclaw-gateway for the full list.
OTel metricPrometheus name in CoralogixWhat it tracks
openclaw.tokensopenclaw_tokens_1_totalToken usage (openclaw_token, openclaw_model, openclaw_provider, openclaw_channel)
openclaw.cost.usdopenclaw_cost_usd_1_totalCost in USD (openclaw_channel, openclaw_provider, openclaw_model)
openclaw.run.duration_msopenclaw_run_duration_ms_{bucket,sum,count,min,max}Model run duration
openclaw.message.processedopenclaw_message_processed_1_totalMessages processed per channel and outcome
openclaw.queue.depthopenclaw_queue_depth_1_{bucket,sum,count,min,max}Command queue depth per lane
openclaw.session.stateopenclaw_session_state_1_totalSession state transitions

Traces

Trace spans cover every model run, webhook, and message processing event. Filter in Tracing by service name openclaw-gateway.
SpanKey attributes
openclaw.model.usageopenclaw.tokens.*, openclaw.channel, openclaw.provider, openclaw.model, openclaw.sessionId
openclaw.message.processedopenclaw.channel, openclaw.outcome, openclaw.sessionId
openclaw.webhook.processedopenclaw.channel, openclaw.webhook, openclaw.chatId
openclaw.webhook.erroropenclaw.channel, openclaw.webhook, openclaw.error
openclaw.session.stuckopenclaw.state, openclaw.ageMs, openclaw.sessionId

Logs

Log export is off by default (logs: false). When turned on, OpenClaw exports its structured gateway logs as OTel log records over OTLP. Query them in Logs filtered by application name openclaw and subsystem openclaw-gateway.

Advanced configuration

SettingDefaultPurpose
diagnostics.otel.flushIntervalMs60000 msHow often metrics and logs flush
diagnostics.otel.sampleRate1.0Trace sampling rate (0.0 to 1.0, root spans only)
diagnostics.otel.tracestrueTurn trace export on or off
diagnostics.otel.metricstrueTurn metric export on or off
diagnostics.otel.logsfalseTurn on OTLP log export (can produce high volume)
diagnostics.flagsTurn on targeted debug logs without raising global log level

Permissions

ResourceActionDescription
Send-Your-Data API keyIngest metrics, logs, and tracesRequired to export OTel signals to Coralogix

For details, see Roles and permissions.

Troubleshoot

No data appears after restarting the gateway Cause: the diagnostics-otel plugin is not active. Fix: confirm both plugins.allow includes "diagnostics-otel" and plugins.entries.diagnostics-otel.enabled is set to true in ~/.openclaw/openclaw.json.

Metrics appear but traces do not Cause: diagnostics.otel.traces is set to false. Fix: set it to true and restart the gateway.

High log volume after turning on log export Cause: OpenClaw exports all structured gateway logs when logs is true. Fix: set diagnostics.otel.logs to false or reduce the flush interval to batch exports more efficiently.