@openclaw/diagnostics-prometheus 2026.7.2-beta.7 → 2026.7.33
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 +6 -8
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isInternalDiagnosticEventMetadata, redactSensitiveText } from "./api.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
3
|
//#region extensions/diagnostics-prometheus/src/service.ts
|
|
5
4
|
const DURATION_BUCKETS_SECONDS = [
|
|
6
5
|
.005,
|
|
@@ -195,7 +194,8 @@ function createPrometheusMetricStore() {
|
|
|
195
194
|
};
|
|
196
195
|
}
|
|
197
196
|
function safeErrorMessage(err) {
|
|
198
|
-
|
|
197
|
+
const message = err instanceof Error ? err.message ?? err.name : String(err);
|
|
198
|
+
return redactSensitiveText(message).replaceAll("\0", " ").replace(/[\r\n\t\u2028\u2029]/gu, " ").slice(0, 500);
|
|
199
199
|
}
|
|
200
200
|
function shouldRecordDiagnosticEvent(metadata) {
|
|
201
201
|
return metadata.trusted || isInternalDiagnosticEventMetadata(metadata);
|
|
@@ -259,7 +259,6 @@ function modelCallLabels(evt) {
|
|
|
259
259
|
api: lowCardinalityLabel(evt.api),
|
|
260
260
|
error_category: evt.type === "model.call.error" ? lowCardinalityLabel(evt.errorCategory, "other") : "none",
|
|
261
261
|
model: lowCardinalityLabel(evt.model),
|
|
262
|
-
observation_unit: evt.observationUnit === "turn" ? "turn" : "request",
|
|
263
262
|
outcome: evt.type === "model.call.error" ? "error" : "completed",
|
|
264
263
|
provider: lowCardinalityLabel(evt.provider),
|
|
265
264
|
transport: lowCardinalityLabel(evt.transport)
|
|
@@ -398,8 +397,8 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
398
397
|
return;
|
|
399
398
|
case "model.call.completed":
|
|
400
399
|
case "model.call.error":
|
|
401
|
-
store.histogram("openclaw_model_call_duration_seconds", "
|
|
402
|
-
store.counter("openclaw_model_call_total", "
|
|
400
|
+
store.histogram("openclaw_model_call_duration_seconds", "Provider model call duration in seconds.", modelCallLabels(evt), seconds(evt.durationMs));
|
|
401
|
+
store.counter("openclaw_model_call_total", "Provider model calls completed by outcome.", modelCallLabels(evt));
|
|
403
402
|
return;
|
|
404
403
|
case "model.failover":
|
|
405
404
|
store.counter("openclaw_model_failover_total", "Model failovers by source, destination, lane, and reason.", modelFailoverLabels(evt));
|
|
@@ -549,8 +548,8 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
549
548
|
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));
|
|
550
549
|
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));
|
|
551
550
|
store.gauge("openclaw_diagnostic_async_queue_length", "Latest async diagnostic queue length after a drop summary.", {}, numericValue(evt.queueLength));
|
|
552
|
-
|
|
553
|
-
case "diagnostic.heartbeat":
|
|
551
|
+
return;
|
|
552
|
+
case "diagnostic.heartbeat": return;
|
|
554
553
|
case "telemetry.exporter":
|
|
555
554
|
store.counter("openclaw_telemetry_exporter_total", "Telemetry exporter lifecycle events.", {
|
|
556
555
|
exporter: lowCardinalityLabel(evt.exporter),
|
|
@@ -562,7 +561,6 @@ function recordDiagnosticEvent(store, evt, metadata) {
|
|
|
562
561
|
case "payload.large":
|
|
563
562
|
store.counter("openclaw_payload_large_total", "Oversized payload diagnostics by surface and action.", payloadLargeLabels(evt));
|
|
564
563
|
store.histogram("openclaw_payload_large_bytes", "Oversized payload byte sizes by surface and action.", payloadLargeLabels(evt), numericValue(evt.bytes), BYTE_BUCKETS);
|
|
565
|
-
default:
|
|
566
564
|
}
|
|
567
565
|
}
|
|
568
566
|
function createMetricsHandler(store) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/diagnostics-prometheus",
|
|
3
|
-
"version": "2026.7.
|
|
3
|
+
"version": "2026.7.33",
|
|
4
4
|
"description": "OpenClaw diagnostics Prometheus exporter for runtime metrics.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.4.25"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.7.
|
|
21
|
+
"pluginApi": ">=2026.7.33"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.7.
|
|
24
|
+
"openclawVersion": "2026.7.33"
|
|
25
25
|
},
|
|
26
26
|
"release": {
|
|
27
27
|
"publishToClawHub": true,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"openclaw": ">=2026.7.
|
|
40
|
+
"openclaw": ">=2026.7.33"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"openclaw": {
|