惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
J
Java Code Geeks
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
L
LangChain Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Martin Fowler
Martin Fowler
月光博客
月光博客
Y
Y Combinator Blog
U
Unit 42
D
Docker
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
Add stdout diagnostics OTEL log exporter · openclaw/openc...
jesse-merhi · 2026-06-19 · via Recent Commits to openclaw:main
11

---

2-

summary: "Export OpenClaw diagnostics to any OpenTelemetry collector via the diagnostics-otel plugin (OTLP/HTTP)"

2+

summary: "Export OpenClaw diagnostics to OpenTelemetry collectors or stdout JSONL via the diagnostics-otel plugin"

33

title: "OpenTelemetry export"

44

read_when:

55

- You want to send OpenClaw model usage, message flow, or session metrics to an OpenTelemetry collector

@@ -8,17 +8,19 @@ read_when:

88

---

991010

OpenClaw exports diagnostics through the official `diagnostics-otel` plugin

11-

using **OTLP/HTTP (protobuf)**. Any collector or backend that accepts OTLP/HTTP

12-

works without code changes. For local file logs and how to read them, see

13-

[Logging](/logging).

11+

using **OTLP/HTTP (protobuf)**. Logs can also be written as stdout JSONL for

12+

container and sandbox log pipelines. Any collector or backend that accepts

13+

OTLP/HTTP works without code changes. For local file logs and how to read them,

14+

see [Logging](/logging).

14151516

## How it fits together

16171718

- **Diagnostics events** are structured, in-process records emitted by the

1819

Gateway and bundled plugins for model runs, message flow, sessions, queues,

1920

and exec.

2021

- **`diagnostics-otel` plugin** subscribes to those events and exports them as

21-

OpenTelemetry **metrics**, **traces**, and **logs** over OTLP/HTTP.

22+

OpenTelemetry **metrics**, **traces**, and **logs** over OTLP/HTTP. It can

23+

also mirror diagnostic log records to stdout JSONL.

2224

- **Provider calls** receive a W3C `traceparent` header from OpenClaw's

2325

trusted model-call span context when the provider transport accepts custom

2426

headers. Plugin-emitted trace context is not propagated.

@@ -74,11 +76,13 @@ openclaw plugins enable diagnostics-otel

7476

| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

7577

| **Metrics** | Counters and histograms for token usage, cost, run duration, failover, skill usage, message flow, Talk events, queue lanes, session state/recovery, tool execution, oversized payloads, exec, and memory pressure. |

7678

| **Traces** | Spans for model usage, model calls, harness lifecycle, skill usage, tool execution, exec, webhook/message processing, context assembly, and tool loops. |

77-

| **Logs** | Structured `logging.file` records exported over OTLP when `diagnostics.otel.logs` is enabled; log bodies are withheld unless content capture is explicitly enabled. |

79+

| **Logs** | Structured `logging.file` records exported over OTLP or stdout JSONL when `diagnostics.otel.logs` is enabled; log bodies are withheld unless content capture is explicitly enabled. |

78807981

Toggle `traces`, `metrics`, and `logs` independently. Traces and metrics

8082

default to on when `diagnostics.otel.enabled` is true. Logs default to off and

81-

are exported only when `diagnostics.otel.logs` is explicitly `true`.

83+

are exported only when `diagnostics.otel.logs` is explicitly `true`. Log export

84+

defaults to OTLP; set `diagnostics.otel.logsExporter` to `stdout` for JSONL on

85+

stdout, or `both` to send each diagnostic log record to OTLP and stdout.

82868387

## Configuration reference

8488

@@ -98,6 +102,7 @@ are exported only when `diagnostics.otel.logs` is explicitly `true`.

98102

traces: true,

99103

metrics: true,

100104

logs: true,

105+

logsExporter: "otlp", // otlp | stdout | both

101106

sampleRate: 0.2, // root-span sampler, 0.0..1.0

102107

flushIntervalMs: 60000, // metric export interval (min 1000ms)

103108

captureContent: {

@@ -176,6 +181,11 @@ on the public diagnostic event bus.

176181

- **Logs:** OTLP logs respect `logging.level` (file log level). They use the

177182

diagnostic log-record redaction path, not console formatting. High-volume

178183

installs should prefer OTLP collector sampling/filtering over local sampling.

184+

Set `diagnostics.otel.logsExporter: "stdout"` when your platform already

185+

ships stdout/stderr to a log processor and you do not have an OTLP logs

186+

collector. Stdout records are one JSON object per line with `ts`, `signal`,

187+

`service.name`, severity, body, redacted attributes, and trusted trace fields

188+

when available.

179189

- **File-log correlation:** JSONL file logs include top-level `traceId`,

180190

`spanId`, `parentSpanId`, and `traceFlags` when the log call carries a valid

181191

diagnostic trace context, which lets log processors join local log lines with