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

推荐订阅源

小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
博客园 - 【当耐特】
博客园_首页
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
V
Visual Studio Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler

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
feat(diagnostics-otel): export memory diagnostics · openc...
vincentkoc · 2026-04-26 · via Recent Commits to openclaw:main

@@ -676,6 +676,33 @@ export function createDiagnosticsOtelService(): OpenClawPluginService {

676676

unit: "ms",

677677

description: "Exec process duration",

678678

});

679+

const memoryRssHistogram = meter.createHistogram("openclaw.memory.rss_bytes", {

680+

unit: "By",

681+

description: "Resident set size reported by diagnostic memory samples",

682+

});

683+

const memoryHeapUsedHistogram = meter.createHistogram("openclaw.memory.heap_used_bytes", {

684+

unit: "By",

685+

description: "Heap used bytes reported by diagnostic memory samples",

686+

});

687+

const memoryHeapTotalHistogram = meter.createHistogram("openclaw.memory.heap_total_bytes", {

688+

unit: "By",

689+

description: "Heap total bytes reported by diagnostic memory samples",

690+

});

691+

const memoryExternalHistogram = meter.createHistogram("openclaw.memory.external_bytes", {

692+

unit: "By",

693+

description: "External memory bytes reported by diagnostic memory samples",

694+

});

695+

const memoryArrayBuffersHistogram = meter.createHistogram(

696+

"openclaw.memory.array_buffers_bytes",

697+

{

698+

unit: "By",

699+

description: "ArrayBuffer bytes reported by diagnostic memory samples",

700+

},

701+

);

702+

const memoryPressureCounter = meter.createCounter("openclaw.memory.pressure", {

703+

unit: "1",

704+

description: "Diagnostic memory pressure events",

705+

});

679706680707

let recordLogRecord:

681708

| ((

@@ -1126,6 +1153,65 @@ export function createDiagnosticsOtelService(): OpenClawPluginService {

11261153

span.end(evt.ts);

11271154

};

112811551156+

const recordMemoryUsageMetrics = (

1157+

evt: Extract<

1158+

DiagnosticEventPayload,

1159+

{ type: "diagnostic.memory.sample" | "diagnostic.memory.pressure" }

1160+

>,

1161+

attrs: Record<string, string> = {},

1162+

) => {

1163+

memoryRssHistogram.record(evt.memory.rssBytes, attrs);

1164+

memoryHeapUsedHistogram.record(evt.memory.heapUsedBytes, attrs);

1165+

memoryHeapTotalHistogram.record(evt.memory.heapTotalBytes, attrs);

1166+

memoryExternalHistogram.record(evt.memory.externalBytes, attrs);

1167+

memoryArrayBuffersHistogram.record(evt.memory.arrayBuffersBytes, attrs);

1168+

};

1169+1170+

const recordMemorySample = (

1171+

evt: Extract<DiagnosticEventPayload, { type: "diagnostic.memory.sample" }>,

1172+

) => {

1173+

recordMemoryUsageMetrics(evt);

1174+

};

1175+1176+

const recordMemoryPressure = (

1177+

evt: Extract<DiagnosticEventPayload, { type: "diagnostic.memory.pressure" }>,

1178+

) => {

1179+

const attrs = {

1180+

"openclaw.memory.level": evt.level,

1181+

"openclaw.memory.reason": evt.reason,

1182+

};

1183+

memoryPressureCounter.add(1, attrs);

1184+

recordMemoryUsageMetrics(evt, attrs);

1185+

if (!tracesEnabled) {

1186+

return;

1187+

}

1188+

const spanAttrs: Record<string, string | number | boolean> = {

1189+

...attrs,

1190+

"openclaw.memory.rss_bytes": evt.memory.rssBytes,

1191+

"openclaw.memory.heap_used_bytes": evt.memory.heapUsedBytes,

1192+

"openclaw.memory.heap_total_bytes": evt.memory.heapTotalBytes,

1193+

"openclaw.memory.external_bytes": evt.memory.externalBytes,

1194+

"openclaw.memory.array_buffers_bytes": evt.memory.arrayBuffersBytes,

1195+

...(evt.thresholdBytes !== undefined

1196+

? { "openclaw.memory.threshold_bytes": evt.thresholdBytes }

1197+

: {}),

1198+

...(evt.rssGrowthBytes !== undefined

1199+

? { "openclaw.memory.rss_growth_bytes": evt.rssGrowthBytes }

1200+

: {}),

1201+

...(evt.windowMs !== undefined ? { "openclaw.memory.window_ms": evt.windowMs } : {}),

1202+

};

1203+

const span = spanWithDuration("openclaw.memory.pressure", spanAttrs, 0, {

1204+

endTimeMs: evt.ts,

1205+

});

1206+

if (evt.level === "critical") {

1207+

span.setStatus({

1208+

code: SpanStatusCode.ERROR,

1209+

message: evt.reason,

1210+

});

1211+

}

1212+

span.end(evt.ts);

1213+

};

1214+11291215

const recordRunCompleted = (

11301216

evt: Extract<DiagnosticEventPayload, { type: "run.completed" }>,

11311217

metadata: DiagnosticEventMetadata,

@@ -1470,11 +1556,15 @@ export function createDiagnosticsOtelService(): OpenClawPluginService {

14701556

case "tool.loop":

14711557

recordToolLoop(evt);

14721558

return;

1559+

case "diagnostic.memory.sample":

1560+

recordMemorySample(evt);

1561+

return;

1562+

case "diagnostic.memory.pressure":

1563+

recordMemoryPressure(evt);

1564+

return;

14731565

case "tool.execution.started":

14741566

case "run.started":

14751567

case "model.call.started":

1476-

case "diagnostic.memory.sample":

1477-

case "diagnostic.memory.pressure":

14781568

case "payload.large":

14791569

return;

14801570

}