




















@@ -310,7 +310,8 @@ Notes:
310310- You can also enable the plugin with `openclaw plugins enable diagnostics-otel`.
311311- `protocol` currently supports `http/protobuf` only. `grpc` is ignored.
312312- Metrics include token usage, cost, context size, run duration, and message-flow
313- counters/histograms (webhooks, queueing, session state, queue depth/wait).
313+ counters/histograms (webhooks, queueing, session state, queue depth/wait),
314+ plus GenAI token usage and model-call duration histograms.
314315- Traces/metrics can be toggled with `traces` / `metrics` (default: on). Traces
315316 include model usage spans plus webhook/message processing spans when enabled.
316317- Raw model/tool content is not exported by default. Use
@@ -319,6 +320,10 @@ Notes:
319320- Set `headers` when your collector requires auth.
320321- Environment variables supported: `OTEL_EXPORTER_OTLP_ENDPOINT`,
321322`OTEL_SERVICE_NAME`, `OTEL_EXPORTER_OTLP_PROTOCOL`.
323+- Set `OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental` to emit the
324+ latest experimental GenAI provider span attribute (`gen_ai.provider.name`)
325+ instead of the legacy span attribute (`gen_ai.system`). GenAI metrics always
326+ use bounded, low-cardinality semantic attributes.
322327- Set `OPENCLAW_OTEL_PRELOADED=1` when another preload or host process already
323328 registered the global OpenTelemetry SDK. In that mode the plugin does not start
324329 or shut down its own SDK, but it still wires OpenClaw diagnostic listeners and
@@ -337,8 +342,11 @@ Model usage:
337342- `openclaw.context.tokens` (histogram, attrs: `openclaw.context`,
338343`openclaw.channel`, `openclaw.provider`, `openclaw.model`)
339344- `gen_ai.client.token.usage` (histogram, GenAI semantic-conventions metric,
340- attrs: `gen_ai.token.type` = `input`/`output`, `gen_ai.system`,
345+ attrs: `gen_ai.token.type` = `input`/`output`, `gen_ai.provider.name`,
341346`gen_ai.operation.name`, `gen_ai.request.model`)
347+- `gen_ai.client.operation.duration` (histogram, seconds, GenAI
348+ semantic-conventions metric, attrs: `gen_ai.provider.name`,
349+`gen_ai.operation.name`, `gen_ai.request.model`, optional `error.type`)
342350343351Message flow:
344352@@ -392,11 +400,16 @@ Diagnostics internals (memory + tool loop):
392400- `openclaw.model.usage`
393401- `openclaw.channel`, `openclaw.provider`, `openclaw.model`
394402- `openclaw.tokens.*` (input/output/cache_read/cache_write/total)
403+- `gen_ai.system` by default, or `gen_ai.provider.name` when latest GenAI
404+ semantic conventions are opted in
405+- `gen_ai.request.model`, `gen_ai.operation.name`, `gen_ai.usage.*`
395406- `openclaw.run`
396407- `openclaw.outcome`, `openclaw.channel`, `openclaw.provider`,
397408`openclaw.model`, `openclaw.errorCategory`
398409- `openclaw.model.call`
399-- `gen_ai.system`, `gen_ai.request.model`, `gen_ai.operation.name`,
410+- `gen_ai.system` by default, or `gen_ai.provider.name` when latest GenAI
411+ semantic conventions are opted in
412+- `gen_ai.request.model`, `gen_ai.operation.name`,
400413`openclaw.provider`, `openclaw.model`, `openclaw.api`,
401414`openclaw.transport`, `openclaw.provider.request_id_hash` (bounded
402415 SHA-based hash of the upstream provider request id; raw ids are not
@@ -447,6 +460,9 @@ classes you opted into.
447460`OTEL_EXPORTER_OTLP_ENDPOINT`.
448461- If the endpoint already contains `/v1/traces` or `/v1/metrics`, it is used as-is.
449462- If the endpoint already contains `/v1/logs`, it is used as-is for logs.
463+- `OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental` controls only the
464+ GenAI span provider attribute shape. Existing dashboards that read
465+`gen_ai.system` can keep the default until they migrate.
450466- `OPENCLAW_OTEL_PRELOADED=1` reuses an externally registered OpenTelemetry SDK
451467 for traces/metrics instead of starting a plugin-owned NodeSDK.
452468- `diagnostics.otel.logs` enables OTLP log export for the main logger output.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。