diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 05bb07e5e..fa663c874 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "ffa84cdc025b3396d5044e322fbe6ff27cbeaf22", - "syncedAt": "2026-04-26T20:24:11.567Z" + "sha": "f0566e410ab8cb81e2ff84b80d0cc55b4c8d57a0", + "syncedAt": "2026-04-26T20:44:56.932Z" } diff --git a/docs/gateway/opentelemetry.md b/docs/gateway/opentelemetry.md index 7eb668fa7..5614f8e4c 100644 --- a/docs/gateway/opentelemetry.md +++ b/docs/gateway/opentelemetry.md @@ -165,6 +165,10 @@ When any subkey is enabled, model and tool spans get bounded, redacted - `openclaw.context.tokens` (histogram, attrs: `openclaw.context`, `openclaw.channel`, `openclaw.provider`, `openclaw.model`) - `gen_ai.client.token.usage` (histogram, GenAI semantic-conventions metric, attrs: `gen_ai.token.type` = `input`/`output`, `gen_ai.provider.name`, `gen_ai.operation.name`, `gen_ai.request.model`) - `gen_ai.client.operation.duration` (histogram, seconds, GenAI semantic-conventions metric, attrs: `gen_ai.provider.name`, `gen_ai.operation.name`, `gen_ai.request.model`, optional `error.type`) +- `openclaw.model_call.duration_ms` (histogram, attrs: `openclaw.provider`, `openclaw.model`, `openclaw.api`, `openclaw.transport`) +- `openclaw.model_call.request_bytes` (histogram, UTF-8 byte size of the final model request payload; no raw payload content) +- `openclaw.model_call.response_bytes` (histogram, UTF-8 byte size of streamed model response events; no raw response content) +- `openclaw.model_call.time_to_first_byte_ms` (histogram, elapsed time before the first streamed response event) ### Message flow @@ -216,6 +220,7 @@ When any subkey is enabled, model and tool spans get bounded, redacted - `openclaw.model.call` - `gen_ai.system` by default, or `gen_ai.provider.name` when the latest GenAI semantic conventions are opted in - `gen_ai.request.model`, `gen_ai.operation.name`, `openclaw.provider`, `openclaw.model`, `openclaw.api`, `openclaw.transport` + - `openclaw.model_call.request_bytes`, `openclaw.model_call.response_bytes`, `openclaw.model_call.time_to_first_byte_ms` - `openclaw.provider.request_id_hash` (bounded SHA-based hash of the upstream provider request id; raw ids are not exported) - `openclaw.harness.run` - `openclaw.harness.id`, `openclaw.harness.plugin`, `openclaw.outcome`, `openclaw.provider`, `openclaw.model`, `openclaw.channel` diff --git a/docs/logging.md b/docs/logging.md index e250f0320..9b09b55c8 100644 --- a/docs/logging.md +++ b/docs/logging.md @@ -164,6 +164,19 @@ OpenClaw writes the trace fields as top-level JSON keys (`traceId`, `spanId`, `parentSpanId`, `traceFlags`) so external log processors can correlate the line with OTEL spans and provider `traceparent` propagation. +### Model call size and timing + +Model-call diagnostics record bounded request/response measurements without +capturing raw prompt or response content: + +- `requestPayloadBytes`: UTF-8 byte size of the final model request payload +- `responseStreamBytes`: UTF-8 byte size of streamed model response events +- `timeToFirstByteMs`: elapsed time before the first streamed response event +- `durationMs`: total model-call duration + +These fields are available to diagnostic snapshots, model-call plugin hooks, and +OTEL model-call spans/metrics when diagnostics export is enabled. + ### Console styles `logging.consoleStyle`: