Exported spans
-
openclaw.gateway.rpc.response,openclaw.gateway.rpc.handler,openclaw.gateway.rpc.dispatch- Completed phase observations with
openclaw.gateway.rpc.method,openclaw.gateway.rpc.phase, andopenclaw.gateway.rpc.outcome - Handler spans include
openclaw.gateway.rpc.admission_ms; dispatch spans includeopenclaw.gateway.rpc.response, the response state at dispatch settlement - Preserve a supplied upstream request parent; they do not introduce a long-lived RPC parent span or change downstream trace propagation
- Completed phase observations with
-
openclaw.model.usageopenclaw.channel,openclaw.provider,openclaw.model- Optional host-derived
openclaw.pluginonly for trusted plugin runtime completions openclaw.tokens.*(input/output/cache_read/cache_write/total)gen_ai.systemby default, orgen_ai.provider.namewhen the latest GenAI semantic conventions are opted ingen_ai.request.model,gen_ai.operation.name,gen_ai.usage.*
openclaw.runopenclaw.outcome,openclaw.channel,openclaw.provider,openclaw.model,openclaw.errorCategory
openclaw.model.callgen_ai.systemby default, orgen_ai.provider.namewhen the latest GenAI semantic conventions are opted ingen_ai.request.model,gen_ai.operation.name,openclaw.provider,openclaw.model,openclaw.api,openclaw.transport,openclaw.model_call.observation_unit(requestorturn)openclaw.errorCategory,error.type, and optionalopenclaw.failureKindon errorsopenclaw.model_call.request_bytes,openclaw.model_call.response_bytes,openclaw.model_call.time_to_first_byte_msopenclaw.model_call.prompt.input_messages_count,openclaw.model_call.prompt.input_messages_chars,openclaw.model_call.prompt.system_prompt_chars,openclaw.model_call.prompt.tool_definitions_count,openclaw.model_call.prompt.tool_definitions_chars,openclaw.model_call.prompt.total_chars(safe component sizes only, no prompt text)openclaw.model_call.usage.*andgen_ai.usage.*when the result carries usage for that request or aggregate turn- Span event
openclaw.provider.requestwith attributeopenclaw.upstreamRequestIdHash(bounded, hash-based) when the upstream provider result exposes a request id; raw ids are never exported - With
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental, request spans use the latest GenAI inference span name{gen_ai.operation.name} {gen_ai.request.model}. Turn spans useinvoke_agentbecause OpenClaw does not claim a native agent name from the opaque CLI boundary. Both useCLIENTspan kind instead ofopenclaw.model.call.
openclaw.harness.runopenclaw.harness.id,openclaw.harness.plugin,openclaw.outcome,openclaw.provider,openclaw.model,openclaw.channel- On completion:
openclaw.harness.result_classification,openclaw.harness.yield_detected,openclaw.harness.items.started,openclaw.harness.items.completed,openclaw.harness.items.active - On error:
openclaw.harness.phase,openclaw.errorCategory, optionalopenclaw.harness.cleanup_failed
openclaw.tool.executiongen_ai.tool.name,gen_ai.operation.name(execute_tool),openclaw.toolName,openclaw.tool.source, optionalgen_ai.tool.call.id,openclaw.tool.owner,openclaw.tool.params.*- Optional
openclaw.errorCategory/openclaw.errorCodeon errors,openclaw.deniedReasonandopenclaw.outcome=blockedwhen denied by policy or sandbox
openclaw.execopenclaw.exec.target,openclaw.exec.mode,openclaw.outcome,openclaw.failureKind,openclaw.exec.command_length,openclaw.exec.exit_code,openclaw.exec.exit_signal,openclaw.exec.timed_out
openclaw.webhook.processedopenclaw.channel,openclaw.webhook
openclaw.webhook.erroropenclaw.channel,openclaw.webhook,openclaw.error
openclaw.message.processedopenclaw.channel,openclaw.outcome,openclaw.reason
openclaw.message.deliveryopenclaw.channel,openclaw.delivery.kind,openclaw.outcome,openclaw.errorCategory,openclaw.delivery.result_count
openclaw.session.stuckopenclaw.state,openclaw.ageMs,openclaw.queueDepth
openclaw.context.assembledopenclaw.prompt.size,openclaw.history.size,openclaw.context.tokens,openclaw.errorCategory(no prompt, history, response, or session-key content)
openclaw.tool.loopopenclaw.toolName,openclaw.loop.level,openclaw.loop.action,openclaw.loop.detector,openclaw.loop.count, optionalopenclaw.loop.paired_tool(no loop messages, params, or tool output)
openclaw.memory.pressureopenclaw.memory.level,openclaw.memory.reason,openclaw.memory.rss_bytes,openclaw.memory.heap_used_bytes,openclaw.memory.heap_total_bytes,openclaw.memory.external_bytes,openclaw.memory.array_buffers_bytes, optionalopenclaw.memory.threshold_bytes/openclaw.memory.rss_growth_bytes/openclaw.memory.window_ms
openclaw.content.* attributes for the specific
content classes you opted into.
Diagnostic event catalog
The events below back the metrics and spans above. Public events are also available for direct plugin subscription; trusted core events such asmodel.usage are restricted to authorized internal consumers.
run.progress and run.execution_phase are direct-only lifecycle signals;
the diagnostics-otel plugin does not export them as standalone OTLP signals.
Event kinds and run.execution_phase.phase values are additive. TypeScript
consumers should keep default branches instead of assuming either union is
permanently exhaustive.
Model usage
model.usage is a trusted, in-process diagnostic event, not a JSONL log
record. A representative event has this shape:
tsis a Unix timestamp in milliseconds;seqis process-local.usageholds turn-level token counts.promptTokensincludesinput,cacheRead, andcacheWrite;lastCallUsage, when available, describes the final model call.context.usedis the current prompt/context snapshot and can be lower thanusage.totalwhen cached input or tool-loop calls are involved.- Provider/model/session identifiers, token buckets,
lastCallUsage,context,costUsd,durationMs, andtracefields are optional.costUsdis an estimate and can be absent when model pricing is unavailable; it is not provider-reported billing. Trace context can also includeparentSpanId.
/tmp/openclaw/openclaw-YYYY-MM-DD.log JSONL file and
diagnostics.otel.logsExporter: "stdout" contain ordinary log records, not raw
model.usage events. Public diagnostic subscriptions and
diagnostics.stability do not expose trusted core usage events. The
diagnostics-otel plugin converts them to metrics such as openclaw.tokens and
openclaw.cost.usd and to openclaw.model.usage spans; those usage metrics
and spans intentionally omit session identifiers.
For an external integration that needs session-correlated usage, query the
authenticated Gateway instead:
operator.read. sessions.usage can include per-session
sessionId, provider/model details, and token/cost summaries; per-session usage
can be temporarily null while its cache refreshes. usage-cost provides
aggregate estimates. Omit agentScope or --all-agents to scope the report
to the default agent. For continuously updated clients,
subscribe to session changes instead of polling usage reports.
See the Gateway RPC method reference
for usage methods and request options.
Message flow
webhook.received/webhook.processed/webhook.errormessage.queued/message.processedmessage.delivery.started/message.delivery.completed/message.delivery.error
gateway.rpc- trusted request observations with phasesreceived,response,handler, anddispatch. Response outcomes areok,error,unavailable, orsuppressed; handler outcomes arereturnedorthrew; dispatch outcomes arereturned,threw,rejected, orcancelled. Dispatch records its response state (none,sent,unavailable, orsuppressed) at settlement; a later response can still arrive. Durations and queue/admission semantics are described in Gateway RPC metrics.
queue.lane.enqueue/queue.lane.dequeuesession.state/session.long_running/session.stalled/session.stuckrun.attempt/run.progressrun.execution_phase(public, session-correlated embedded-runner startup milestones)diagnostic.heartbeat(aggregate counters: webhooks/queue/session)gateway.event_loop.sample(internal metrics-only completed window:intervalMs,delayMaxMs; no reader identity)
harness.run.started/harness.run.completed/harness.run.error- per-run lifecycle for the agent harness. IncludesharnessId, optionalpluginId, provider/model/channel, and run id. Completion addsdurationMs,outcome, optionalresultClassification,yieldDetected, anditemLifecyclecounts. Errors addphase(prepare/start/send/resolve/cleanup),errorCategory, and optionalcleanupFailed.
exec.process.completed- terminal outcome, duration, target, mode, exit code, and failure kind. Command text and working directories are not included.exec.approval.followup_suppressed- stale approval follow-up dropped after a session rebound. IncludesapprovalId,reason(session_rebound),phase(direct_deliveryorgateway_preflight), and the dispatcher timestamp. Session keys, routes, and command text are not included.