On this page
On this page
Gateway
Exported spans and diagnostic events
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, optionalopenclaw.agent(the agent that owns the run when known)- 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.*
Plugin attribution is span-only. It does not add a plugin dimension to shared OpenTelemetry metrics or change Prometheus metric labels.
Embedded and simple model requests compute prompt component sizes only when a
diagnostic subscriber requests them. Activity tracking, the stability recorder,
Prometheus, and metrics-only OpenTelemetry do not request these sizes. Tracing
retains the same pre-provider JSON character counts; these are distinct from the
encoded request's UTF-8 byte count. Internal diagnostic subscribers can set
includePromptStats: false in their event filter to avoid requesting this work.
Omitting the option preserves prompt statistics for interested subscribers.
openclaw.runopenclaw.outcome,openclaw.channel,openclaw.provider,openclaw.model,openclaw.errorCategory, optionalopenclaw.agent
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), optionalopenclaw.agentgen_ai.response.modelon terminal request spans (completed and error) when the provider reported the model that actually served the request — e.g. routed OpenRouter presets,openrouter/auto, or alias models.gen_ai.request.modelandopenclaw.modelkeep the requested id; the response model is observed from the terminal message, omitted when absent, and never attached to aggregate usage or turn spans, used for OpenClaw pricing, or exported as a metric label (unbounded cardinality).model.call.startedis emitted before the provider responds and never carries it.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- Cache-write totals remain in
openclaw.model_call.usage.cache_creation_input_tokensandgen_ai.usage.cache_creation.input_tokens. When reported,openclaw.model_call.usage.cache_creation_input_tokens_1handopenclaw.model_call.usage.cache_creation_input_tokens_5mcarry the provider’s TTL buckets verbatim, including zero; unreported buckets stay absent. TTL subsets are OpenClaw-specific so generic usage consumers do not price both the total and its breakdown. - Span event
openclaw.provider.requestwith attributeopenclaw.upstreamRequestIdHash(bounded, hash-based) when the upstream provider result exposes a request id; raw ids are never exported - Codex turn span event
openclaw.model.response.observedwithopenclaw.upstreamRequestIdHash,openclaw.model_response.timestamp_source = receipt,openclaw.model_response.usage_source = native-normalized,openclaw.model_response.usage_scope = response, and knownopenclaw.model_call.usage.*/gen_ai.usage.*fields. It records an untimed native response observation and does not increment usage metrics. - 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, optionalopenclaw.agent- 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 - Span event
openclaw.agent.commentaryfor completed preambles from supported harnesses, including the built-in runtime, Codex, and Claude CLI. Attributes includeopenclaw.commentary.sequence,openclaw.commentary.text_length, andopenclaw.commentary.content_truncated. The existingdiagnostics.otel.captureContentsetting controls bounded, redacted output-message content. - With
captureContent: true: bounded, redactedinput.valueon start andoutput.value(the runtime's final message text) on completion. For the Claude CLI backend,input.valueis the exact composed prompt the CLI received, after history reseeding, plugin input text transforms, and prompt context; the Codex harness records the turn prompt OpenClaw handed it. The Gemini CLI backend publishes captured content onopenclaw.message.processed(inbound message and the model's final response); it does not record its composed CLI prompt on these run-level spans.
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.*, optionalopenclaw.agent- Optional
openclaw.errorCategory/openclaw.errorCodeon errors,openclaw.deniedReasonandopenclaw.outcome=blockedwhen denied by policy or sandbox
openclaw.skill.usedopenclaw.skill.name,openclaw.skill.source,openclaw.skill.activation, optionalopenclaw.agentandopenclaw.toolName- Optional
openclaw.skill.fingerprint: SHA-256 of the complete instruction body actually delivered byreadorskills_read. Cached reads reuse the delivered identity; unread support files and discovery results do not contribute. The fingerprint is omitted when no traced instruction delivery is known and never labels metrics.
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, optionalopenclaw.agent(the agent that initially ingested the prompt)- Isolated cron agent turns use this span as the parent of their harness spans, keeping model calls, tools, and usage on the same trace through completion or failure.
- With
captureContent: true: bounded, redactedinput.value(inbound message text) andoutput.value(the model's own response text; hook replies and host notices are never captured)
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, optionalopenclaw.agent(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
When content capture is explicitly enabled, model and tool spans can also
include bounded, redacted openclaw.content.* attributes for the specific
content classes you opted into.
openclaw.message.processed and openclaw.harness.run spans follow the same
existing captureContent setting. When it is true, input.value and
output.value carry the inbound message or turn prompt and the model's final
response text, bounded to 128 KiB (131072 UTF-16
code units) per field and redacted through the same sensitive-text filter as
other exported content. output.value records what the LLM actually responded
with — the model's own final response, before delivery filtering — so sentinel
replies such as NO_REPLY appear verbatim; this is LLM-observability data, not
a delivery record. Only the text of the model's last message counts. Text the
model passed to the message tool is an argument to a tool call, not its final
message, so tool-only turns record the model's closing message (usually
NO_REPLY) or nothing; the sent text is on the child openclaw.model.call
output messages and, for the built-in runtime, the openclaw.tool.execution
span (gen_ai.tool.call.arguments). CLI backends do not export tool arguments,
so their message-tool text is not captured on any span. Earlier narration in
the turn ("Checking now…") is never reported as the final response: a message
that ended in a tool call is not final, and CLI turns record only the final
message, never the cumulative reply text. Text the
model did not write is never captured, even when it was delivered to the chat:
plugin hook replies (before_dispatch, before_agent_reply), no-visible-reply
fallbacks, continuation statuses, failure texts, and Gateway restart notices.
Turns where no model produced text carry no output.value.
The captured content is routed as private listener-only payload data to
trusted diagnostics exporters only; it never appears on public event
payloads.
Upgrade note: if you already run with diagnostics.otel.captureContent: true, these message and run span attributes are new — your existing setting
now also exports this prompt and reply content with no further configuration
change. Nothing new is exported while captureContent is unset or false.
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 as
model.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.
Events with no interested subscriber or tracing exporter are discarded before payload enrichment and queuing; they are not buffered for future subscribers. Queued events capture their payloads when emitted, so later producer changes do not change delivery. Listeners share immutable plain-data snapshots; opaque values such as maps and typed arrays retain separate listener copies.
agent.commentary records completed preambles, not text deltas. It carries the
original agent-event sequence and timestamp and attaches to the active harness
span. Recent duplicate completions are suppressed per attempt. Like other
queued diagnostics, commentary may be dropped under queue pressure; the session
transcript remains the durable conversation record. At debug level, the
diagnostic logger also records completion metadata without commentary text.
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.
The Gateway's /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.
Completed memory-flush and Skill Workshop review inference records its own usage and available cost estimate. These internal runs do not add their usage to the foreground conversation's totals.
For an external integration that needs session-correlated usage, query the authenticated Gateway instead:
Both commands require 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
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 and session
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 lifecycle
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. WithcaptureContent: true, started and completed events also carry bounded, redacted turn prompt and final assistant text as private listener-only data exported on spans, never on public payloads.
Exec
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.