@openclaw/diagnostics-prometheus 2026.5.20 → 2026.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -2
- package/npm-shrinkwrap.json +12 -0
- package/package.json +8 -9
package/dist/index.js
CHANGED
|
@@ -53,8 +53,18 @@ const DROPPED_SERIES_COUNTER_NAME = "openclaw_prometheus_series_dropped_total";
|
|
|
53
53
|
function lowCardinalityLabel(value, fallback = "unknown") {
|
|
54
54
|
if (!value) return fallback;
|
|
55
55
|
const redacted = redactSensitiveText(value.trim());
|
|
56
|
+
const redactedLower = redacted.toLowerCase();
|
|
57
|
+
if (redactedLower.startsWith("agent:") || redactedLower.includes(":agent:")) return fallback;
|
|
56
58
|
return LOW_CARDINALITY_VALUE_RE.test(redacted) ? redacted : fallback;
|
|
57
59
|
}
|
|
60
|
+
function lowCardinalityQueueLaneLabel(value, fallback = "unknown") {
|
|
61
|
+
if (!value) return fallback;
|
|
62
|
+
const redacted = redactSensitiveText(value.trim());
|
|
63
|
+
if (redacted.toLowerCase().startsWith("agent:")) return fallback;
|
|
64
|
+
const scopedLaneIndex = redacted.indexOf(":");
|
|
65
|
+
const lane = scopedLaneIndex >= 0 ? redacted.slice(0, scopedLaneIndex) : redacted;
|
|
66
|
+
return LOW_CARDINALITY_VALUE_RE.test(lane) ? lane : fallback;
|
|
67
|
+
}
|
|
58
68
|
function numericValue(value) {
|
|
59
69
|
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
60
70
|
}
|
|
@@ -347,6 +357,32 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
347
357
|
delivery_kind: lowCardinalityLabel(evt.deliveryKind, "other")
|
|
348
358
|
});
|
|
349
359
|
return;
|
|
360
|
+
case "message.received":
|
|
361
|
+
store.counter("openclaw_message_received_total", "Inbound messages received by channel.", {
|
|
362
|
+
channel: lowCardinalityLabel(evt.channel),
|
|
363
|
+
source: lowCardinalityLabel(evt.source)
|
|
364
|
+
});
|
|
365
|
+
return;
|
|
366
|
+
case "message.dispatch.started":
|
|
367
|
+
store.counter("openclaw_message_dispatch_started_total", "Inbound message dispatch attempts started by channel.", {
|
|
368
|
+
channel: lowCardinalityLabel(evt.channel),
|
|
369
|
+
source: lowCardinalityLabel(evt.source)
|
|
370
|
+
});
|
|
371
|
+
return;
|
|
372
|
+
case "message.dispatch.completed":
|
|
373
|
+
store.counter("openclaw_message_dispatch_completed_total", "Inbound message dispatch attempts completed by outcome.", {
|
|
374
|
+
channel: lowCardinalityLabel(evt.channel),
|
|
375
|
+
outcome: evt.outcome,
|
|
376
|
+
reason: lowCardinalityLabel(evt.reason, "none"),
|
|
377
|
+
source: lowCardinalityLabel(evt.source)
|
|
378
|
+
});
|
|
379
|
+
store.histogram("openclaw_message_dispatch_duration_seconds", "Inbound message dispatch duration in seconds.", {
|
|
380
|
+
channel: lowCardinalityLabel(evt.channel),
|
|
381
|
+
outcome: evt.outcome,
|
|
382
|
+
reason: lowCardinalityLabel(evt.reason, "none"),
|
|
383
|
+
source: lowCardinalityLabel(evt.source)
|
|
384
|
+
}, seconds(evt.durationMs));
|
|
385
|
+
return;
|
|
350
386
|
case "message.delivery.completed":
|
|
351
387
|
case "message.delivery.error":
|
|
352
388
|
store.counter("openclaw_message_delivery_total", "Outbound message delivery attempts by outcome.", {
|
|
@@ -374,8 +410,8 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
374
410
|
return;
|
|
375
411
|
case "queue.lane.enqueue":
|
|
376
412
|
case "queue.lane.dequeue":
|
|
377
|
-
store.gauge("openclaw_queue_lane_size", "Current diagnostic queue lane size.", { lane:
|
|
378
|
-
if (evt.type === "queue.lane.dequeue") store.histogram("openclaw_queue_lane_wait_seconds", "Queue lane wait time in seconds.", { lane:
|
|
413
|
+
store.gauge("openclaw_queue_lane_size", "Current diagnostic queue lane size.", { lane: lowCardinalityQueueLaneLabel(evt.lane) }, numericValue(evt.queueSize));
|
|
414
|
+
if (evt.type === "queue.lane.dequeue") store.histogram("openclaw_queue_lane_wait_seconds", "Queue lane wait time in seconds.", { lane: lowCardinalityQueueLaneLabel(evt.lane) }, seconds(evt.waitMs));
|
|
379
415
|
return;
|
|
380
416
|
case "session.state":
|
|
381
417
|
store.counter("openclaw_session_state_total", "Session state observations.", {
|
|
@@ -384,6 +420,13 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
384
420
|
});
|
|
385
421
|
if (evt.queueDepth !== void 0) store.gauge("openclaw_session_queue_depth", "Latest observed session queue depth.", { state: evt.state }, numericValue(evt.queueDepth));
|
|
386
422
|
return;
|
|
423
|
+
case "session.turn.created":
|
|
424
|
+
store.counter("openclaw_session_turn_created_total", "Agent session turns created.", {
|
|
425
|
+
agent: lowCardinalityLabel(evt.agentId),
|
|
426
|
+
channel: lowCardinalityLabel(evt.channel),
|
|
427
|
+
trigger: evt.trigger
|
|
428
|
+
});
|
|
429
|
+
return;
|
|
387
430
|
case "diagnostic.memory.sample":
|
|
388
431
|
store.gauge("openclaw_memory_bytes", "Latest process memory usage by memory kind.", { kind: "rss" }, evt.memory.rssBytes);
|
|
389
432
|
store.gauge("openclaw_memory_bytes", "Latest process memory usage by memory kind.", { kind: "heap_total" }, evt.memory.heapTotalBytes);
|
|
@@ -396,6 +439,13 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
396
439
|
reason: evt.reason
|
|
397
440
|
});
|
|
398
441
|
return;
|
|
442
|
+
case "diagnostic.async_queue.dropped":
|
|
443
|
+
store.counter("openclaw_diagnostic_async_queue_dropped_total", "Async diagnostic queue drops by dropped event class.", { drop_class: "total" }, numericValue(evt.droppedEvents));
|
|
444
|
+
if (evt.droppedTrustedEvents !== void 0) store.counter("openclaw_diagnostic_async_queue_dropped_total", "Async diagnostic queue drops by dropped event class.", { drop_class: "trusted" }, numericValue(evt.droppedTrustedEvents));
|
|
445
|
+
if (evt.droppedUntrustedEvents !== void 0) store.counter("openclaw_diagnostic_async_queue_dropped_total", "Async diagnostic queue drops by dropped event class.", { drop_class: "untrusted" }, numericValue(evt.droppedUntrustedEvents));
|
|
446
|
+
if (evt.droppedPriorityEvents !== void 0) store.counter("openclaw_diagnostic_async_queue_dropped_total", "Async diagnostic queue drops by dropped event class.", { drop_class: "priority" }, numericValue(evt.droppedPriorityEvents));
|
|
447
|
+
store.gauge("openclaw_diagnostic_async_queue_length", "Latest async diagnostic queue length after a drop summary.", {}, numericValue(evt.queueLength));
|
|
448
|
+
return;
|
|
399
449
|
case "diagnostic.heartbeat":
|
|
400
450
|
case "diagnostic.liveness.warning": return;
|
|
401
451
|
case "telemetry.exporter":
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/diagnostics-prometheus",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.22",
|
|
4
4
|
"description": "OpenClaw diagnostics Prometheus exporter",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/openclaw/openclaw"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@openclaw/plugin-sdk": "workspace:*"
|
|
12
|
-
},
|
|
13
10
|
"openclaw": {
|
|
14
11
|
"extensions": [
|
|
15
12
|
"./index.ts"
|
|
@@ -21,10 +18,10 @@
|
|
|
21
18
|
"minHostVersion": ">=2026.4.25"
|
|
22
19
|
},
|
|
23
20
|
"compat": {
|
|
24
|
-
"pluginApi": ">=2026.5.
|
|
21
|
+
"pluginApi": ">=2026.5.22"
|
|
25
22
|
},
|
|
26
23
|
"build": {
|
|
27
|
-
"openclawVersion": "2026.5.
|
|
24
|
+
"openclawVersion": "2026.5.22"
|
|
28
25
|
},
|
|
29
26
|
"release": {
|
|
30
27
|
"publishToClawHub": true,
|
|
@@ -36,14 +33,16 @@
|
|
|
36
33
|
},
|
|
37
34
|
"files": [
|
|
38
35
|
"dist/**",
|
|
39
|
-
"openclaw.plugin.json"
|
|
36
|
+
"openclaw.plugin.json",
|
|
37
|
+
"npm-shrinkwrap.json"
|
|
40
38
|
],
|
|
41
39
|
"peerDependencies": {
|
|
42
|
-
"openclaw": ">=2026.5.
|
|
40
|
+
"openclaw": ">=2026.5.22"
|
|
43
41
|
},
|
|
44
42
|
"peerDependenciesMeta": {
|
|
45
43
|
"openclaw": {
|
|
46
44
|
"optional": true
|
|
47
45
|
}
|
|
48
|
-
}
|
|
46
|
+
},
|
|
47
|
+
"bundledDependencies": []
|
|
49
48
|
}
|