@openclaw/diagnostics-prometheus 2026.5.20 → 2026.5.24-beta.1

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 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
  }
@@ -242,7 +252,17 @@ function toolExecutionLabels(evt) {
242
252
  error_category: evt.type === "tool.execution.error" ? lowCardinalityLabel(evt.errorCategory, "other") : "none",
243
253
  outcome: evt.type === "tool.execution.error" ? "error" : "completed",
244
254
  params_kind: lowCardinalityLabel(evt.paramsSummary?.kind),
245
- tool: lowCardinalityLabel(evt.toolName, "tool")
255
+ tool: lowCardinalityLabel(evt.toolName, "tool"),
256
+ tool_owner: lowCardinalityLabel(evt.toolOwner, "none"),
257
+ tool_source: lowCardinalityLabel(evt.toolSource, "core")
258
+ };
259
+ }
260
+ function skillLabels(evt) {
261
+ return {
262
+ activation: lowCardinalityLabel(evt.activation, "unknown"),
263
+ agent: lowCardinalityLabel(evt.agentId),
264
+ skill: lowCardinalityLabel(evt.skillName, "skill"),
265
+ source: lowCardinalityLabel(evt.skillSource)
246
266
  };
247
267
  }
248
268
  function harnessLabels(evt) {
@@ -324,6 +344,9 @@ function recordDiagnosticEvent(store, evt, metadata) {
324
344
  store.histogram("openclaw_tool_execution_duration_seconds", "Tool execution duration in seconds.", toolExecutionLabels(evt), seconds(evt.durationMs));
325
345
  store.counter("openclaw_tool_execution_total", "Tool executions completed by outcome.", toolExecutionLabels(evt));
326
346
  return;
347
+ case "skill.used":
348
+ store.counter("openclaw_skill_used_total", "Skills used by agent runs.", skillLabels(evt));
349
+ return;
327
350
  case "harness.run.completed":
328
351
  case "harness.run.error":
329
352
  store.histogram("openclaw_harness_run_duration_seconds", "Agent harness run duration in seconds.", harnessLabels(evt), seconds(evt.durationMs));
@@ -347,6 +370,32 @@ function recordDiagnosticEvent(store, evt, metadata) {
347
370
  delivery_kind: lowCardinalityLabel(evt.deliveryKind, "other")
348
371
  });
349
372
  return;
373
+ case "message.received":
374
+ store.counter("openclaw_message_received_total", "Inbound messages received by channel.", {
375
+ channel: lowCardinalityLabel(evt.channel),
376
+ source: lowCardinalityLabel(evt.source)
377
+ });
378
+ return;
379
+ case "message.dispatch.started":
380
+ store.counter("openclaw_message_dispatch_started_total", "Inbound message dispatch attempts started by channel.", {
381
+ channel: lowCardinalityLabel(evt.channel),
382
+ source: lowCardinalityLabel(evt.source)
383
+ });
384
+ return;
385
+ case "message.dispatch.completed":
386
+ store.counter("openclaw_message_dispatch_completed_total", "Inbound message dispatch attempts completed by outcome.", {
387
+ channel: lowCardinalityLabel(evt.channel),
388
+ outcome: evt.outcome,
389
+ reason: lowCardinalityLabel(evt.reason, "none"),
390
+ source: lowCardinalityLabel(evt.source)
391
+ });
392
+ store.histogram("openclaw_message_dispatch_duration_seconds", "Inbound message dispatch duration in seconds.", {
393
+ channel: lowCardinalityLabel(evt.channel),
394
+ outcome: evt.outcome,
395
+ reason: lowCardinalityLabel(evt.reason, "none"),
396
+ source: lowCardinalityLabel(evt.source)
397
+ }, seconds(evt.durationMs));
398
+ return;
350
399
  case "message.delivery.completed":
351
400
  case "message.delivery.error":
352
401
  store.counter("openclaw_message_delivery_total", "Outbound message delivery attempts by outcome.", {
@@ -374,8 +423,8 @@ function recordDiagnosticEvent(store, evt, metadata) {
374
423
  return;
375
424
  case "queue.lane.enqueue":
376
425
  case "queue.lane.dequeue":
377
- store.gauge("openclaw_queue_lane_size", "Current diagnostic queue lane size.", { lane: lowCardinalityLabel(evt.lane) }, numericValue(evt.queueSize));
378
- if (evt.type === "queue.lane.dequeue") store.histogram("openclaw_queue_lane_wait_seconds", "Queue lane wait time in seconds.", { lane: lowCardinalityLabel(evt.lane) }, seconds(evt.waitMs));
426
+ store.gauge("openclaw_queue_lane_size", "Current diagnostic queue lane size.", { lane: lowCardinalityQueueLaneLabel(evt.lane) }, numericValue(evt.queueSize));
427
+ 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
428
  return;
380
429
  case "session.state":
381
430
  store.counter("openclaw_session_state_total", "Session state observations.", {
@@ -384,6 +433,13 @@ function recordDiagnosticEvent(store, evt, metadata) {
384
433
  });
385
434
  if (evt.queueDepth !== void 0) store.gauge("openclaw_session_queue_depth", "Latest observed session queue depth.", { state: evt.state }, numericValue(evt.queueDepth));
386
435
  return;
436
+ case "session.turn.created":
437
+ store.counter("openclaw_session_turn_created_total", "Agent session turns created.", {
438
+ agent: lowCardinalityLabel(evt.agentId),
439
+ channel: lowCardinalityLabel(evt.channel),
440
+ trigger: evt.trigger
441
+ });
442
+ return;
387
443
  case "diagnostic.memory.sample":
388
444
  store.gauge("openclaw_memory_bytes", "Latest process memory usage by memory kind.", { kind: "rss" }, evt.memory.rssBytes);
389
445
  store.gauge("openclaw_memory_bytes", "Latest process memory usage by memory kind.", { kind: "heap_total" }, evt.memory.heapTotalBytes);
@@ -396,6 +452,13 @@ function recordDiagnosticEvent(store, evt, metadata) {
396
452
  reason: evt.reason
397
453
  });
398
454
  return;
455
+ case "diagnostic.async_queue.dropped":
456
+ store.counter("openclaw_diagnostic_async_queue_dropped_total", "Async diagnostic queue drops by dropped event class.", { drop_class: "total" }, numericValue(evt.droppedEvents));
457
+ 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));
458
+ 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));
459
+ 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));
460
+ store.gauge("openclaw_diagnostic_async_queue_length", "Latest async diagnostic queue length after a drop summary.", {}, numericValue(evt.queueLength));
461
+ return;
399
462
  case "diagnostic.heartbeat":
400
463
  case "diagnostic.liveness.warning": return;
401
464
  case "telemetry.exporter":
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@openclaw/diagnostics-prometheus",
3
+ "version": "2026.5.24-beta.1",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "@openclaw/diagnostics-prometheus",
9
+ "version": "2026.5.24-beta.1"
10
+ }
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,15 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/diagnostics-prometheus",
3
- "version": "2026.5.20",
3
+ "version": "2026.5.24-beta.1",
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.20"
21
+ "pluginApi": ">=2026.5.24-beta.1"
25
22
  },
26
23
  "build": {
27
- "openclawVersion": "2026.5.20"
24
+ "openclawVersion": "2026.5.24-beta.1"
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.20"
40
+ "openclaw": ">=2026.5.24-beta.1"
43
41
  },
44
42
  "peerDependenciesMeta": {
45
43
  "openclaw": {
46
44
  "optional": true
47
45
  }
48
- }
46
+ },
47
+ "bundledDependencies": []
49
48
  }