@openclaw/diagnostics-prometheus 2026.11.5-beta.1 → 2026.11.5-beta.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/diagnostics-prometheus/api.ts"},{"output":"index.js","source":"extensions/diagnostics-prometheus/index.ts"}],"chunks":[{"output":"api.js","sha256":"a514f9c1b0487fa17674557ed61c64a027d8c883f0f25c7d912d77b89f6c9dc0","facadeSource":"extensions/diagnostics-prometheus/api.ts","sources":[]},{"output":"index.js","sha256":"
|
|
1
|
+
{"version":3,"entries":[{"output":"api.js","source":"extensions/diagnostics-prometheus/api.ts"},{"output":"index.js","source":"extensions/diagnostics-prometheus/index.ts"}],"chunks":[{"output":"api.js","sha256":"a514f9c1b0487fa17674557ed61c64a027d8c883f0f25c7d912d77b89f6c9dc0","facadeSource":"extensions/diagnostics-prometheus/api.ts","sources":[]},{"output":"index.js","sha256":"b8f05403f285dbcf29c043399b291d6af78c154f8c46ed44afc14c6041fe9bc2","facadeSource":"extensions/diagnostics-prometheus/index.ts","sources":["extensions/diagnostics-prometheus/index.ts","extensions/diagnostics-prometheus/src/prometheus-family-budget.ts","extensions/diagnostics-prometheus/src/prometheus-format.ts","extensions/diagnostics-prometheus/src/prometheus-metric-store.ts","extensions/diagnostics-prometheus/src/service-gateway-ws.ts","extensions/diagnostics-prometheus/src/service-memory.ts","extensions/diagnostics-prometheus/src/service-model-usage.ts","extensions/diagnostics-prometheus/src/service-operation-timing.ts","extensions/diagnostics-prometheus/src/service-retention.ts","extensions/diagnostics-prometheus/src/service-sessions.ts","extensions/diagnostics-prometheus/src/service-worker.ts","extensions/diagnostics-prometheus/src/service.ts"]}],"unrenderedSources":["extensions/diagnostics-prometheus/api.ts"]}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { asNonNegativeFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
|
|
5
5
|
import { getPluginRuntimeGatewayRequestScope } from "openclaw/plugin-sdk/plugin-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
8
|
-
|
|
8
|
+
//#region extensions/diagnostics-prometheus/src/prometheus-format.ts
|
|
9
9
|
function sortedLabels(labels) {
|
|
10
10
|
const entries = Object.entries(labels);
|
|
11
11
|
entries.sort(([left], [right]) => left.localeCompare(right));
|
|
@@ -33,7 +33,8 @@ function seconds(ms) {
|
|
|
33
33
|
const value = asNonNegativeFiniteNumber(ms);
|
|
34
34
|
return value === void 0 ? void 0 : value / 1e3;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region extensions/diagnostics-prometheus/src/prometheus-family-budget.ts
|
|
37
38
|
const PROMETHEUS_FAMILY_RESERVES = {
|
|
38
39
|
openclaw_chat_history_requests_total: 4,
|
|
39
40
|
openclaw_chat_history_response_bytes_total: 4,
|
|
@@ -178,7 +179,8 @@ const PROMETHEUS_FAMILY_RESERVES = {
|
|
|
178
179
|
openclaw_worktree_preparation_seconds: 32
|
|
179
180
|
};
|
|
180
181
|
const SHARED_PROMETHEUS_SERIES = 16384 - Object.values(PROMETHEUS_FAMILY_RESERVES).reduce((sum, n) => sum + n, 0);
|
|
181
|
-
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region extensions/diagnostics-prometheus/src/prometheus-metric-store.ts
|
|
182
184
|
function createSeries() {
|
|
183
185
|
return {
|
|
184
186
|
samples: [],
|
|
@@ -493,7 +495,8 @@ function createPrometheusMetricStore(onSeriesDropped) {
|
|
|
493
495
|
render
|
|
494
496
|
};
|
|
495
497
|
}
|
|
496
|
-
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region extensions/diagnostics-prometheus/src/service-gateway-ws.ts
|
|
497
500
|
function createGatewayWsMetricsRecorder(store) {
|
|
498
501
|
const labels = { event: "" };
|
|
499
502
|
const frameLabels = {
|
|
@@ -535,7 +538,8 @@ function createGatewayWsMetricsRecorder(store) {
|
|
|
535
538
|
function recordGatewayWsConnections(store, operators) {
|
|
536
539
|
store.gauge("openclaw_gateway_ws_operator_connections", "Connected authenticated Gateway operator WebSockets.", {}, operators);
|
|
537
540
|
}
|
|
538
|
-
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region extensions/diagnostics-prometheus/src/service-memory.ts
|
|
539
543
|
const WORKER_MEMORY_METRICS = [
|
|
540
544
|
[
|
|
541
545
|
"heapUsed",
|
|
@@ -722,7 +726,8 @@ function recordMemorySample(store, memory, byteBuckets) {
|
|
|
722
726
|
}
|
|
723
727
|
store.histogram("openclaw_memory_rss_bytes", "RSS memory sample distribution in bytes.", {}, asNonNegativeFiniteNumber(memory.rssBytes), byteBuckets);
|
|
724
728
|
}
|
|
725
|
-
|
|
729
|
+
//#endregion
|
|
730
|
+
//#region extensions/diagnostics-prometheus/src/service-model-usage.ts
|
|
726
731
|
const TOKEN_BUCKETS = [
|
|
727
732
|
1,
|
|
728
733
|
4,
|
|
@@ -766,7 +771,8 @@ function recordModelUsage(store, evt) {
|
|
|
766
771
|
store.counter("openclaw_model_cost_usd_total", "Estimated model cost in USD reported by diagnostic usage events.", labels, asNonNegativeFiniteNumber(evt.costUsd) ?? 0);
|
|
767
772
|
store.histogram("openclaw_model_usage_duration_seconds", "Model usage event duration in seconds.", labels, seconds(evt.durationMs));
|
|
768
773
|
}
|
|
769
|
-
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region extensions/diagnostics-prometheus/src/service-operation-timing.ts
|
|
770
776
|
const GC_DURATION_NAME = "openclaw_gc_duration_seconds";
|
|
771
777
|
const GC_DURATION_HELP = "Elapsed garbage collection duration in seconds by collection kind, callback flags, and isolate role.";
|
|
772
778
|
function reserveMainGcHistograms(store) {
|
|
@@ -1098,7 +1104,8 @@ function recordOperationTimingEvent(store, evt, metadata) {
|
|
|
1098
1104
|
}
|
|
1099
1105
|
}
|
|
1100
1106
|
}
|
|
1101
|
-
|
|
1107
|
+
//#endregion
|
|
1108
|
+
//#region extensions/diagnostics-prometheus/src/service-retention.ts
|
|
1102
1109
|
function recordSessionRetention(store, evt) {
|
|
1103
1110
|
if (evt.type === "sessions.event.rows.reset") {
|
|
1104
1111
|
store.counter("openclaw_session_event_rows_reset_total", "Retained session-event wire baselines retired by cause.", { cause: evt.cause }, evt.count);
|
|
@@ -1113,7 +1120,8 @@ function recordSessionRetention(store, evt) {
|
|
|
1113
1120
|
store.gauge("openclaw_session_event_rows_retained_entries", "Session-event field-hash vectors retained across all connections.", {}, evt.entries);
|
|
1114
1121
|
store.gauge("openclaw_session_event_rows_retained_bytes", "Estimated memory retained by session-event field-hash vectors.", {}, evt.estimatedBytes);
|
|
1115
1122
|
}
|
|
1116
|
-
|
|
1123
|
+
//#endregion
|
|
1124
|
+
//#region extensions/diagnostics-prometheus/src/service-sessions.ts
|
|
1117
1125
|
function recordSessionDiagnosticEvent(store, evt) {
|
|
1118
1126
|
switch (evt.type) {
|
|
1119
1127
|
case "session.recovery.requested":
|
|
@@ -1151,7 +1159,8 @@ function recordSessionDiagnosticEvent(store, evt) {
|
|
|
1151
1159
|
});
|
|
1152
1160
|
}
|
|
1153
1161
|
}
|
|
1154
|
-
|
|
1162
|
+
//#endregion
|
|
1163
|
+
//#region extensions/diagnostics-prometheus/src/service-worker.ts
|
|
1155
1164
|
function createWorkerRequestMetricsRecorder(store) {
|
|
1156
1165
|
return (kind, requestClass, requestPhase, queueDepth, queueWaitMs, durationMs, timing) => {
|
|
1157
1166
|
store.gauge("openclaw_worker_queue_depth", "Requests awaiting dispatch across worker owners of this kind.", { kind }, queueDepth);
|
|
@@ -1209,7 +1218,8 @@ function createWorkerRequestMetricsRecorder(store) {
|
|
|
1209
1218
|
}
|
|
1210
1219
|
};
|
|
1211
1220
|
}
|
|
1212
|
-
|
|
1221
|
+
//#endregion
|
|
1222
|
+
//#region extensions/diagnostics-prometheus/src/service.ts
|
|
1213
1223
|
const BYTE_BUCKETS = [
|
|
1214
1224
|
1024,
|
|
1215
1225
|
4096,
|
|
@@ -1644,7 +1654,8 @@ function createDiagnosticsPrometheusExporter() {
|
|
|
1644
1654
|
}
|
|
1645
1655
|
};
|
|
1646
1656
|
}
|
|
1647
|
-
|
|
1657
|
+
//#endregion
|
|
1658
|
+
//#region extensions/diagnostics-prometheus/index.ts
|
|
1648
1659
|
const exporter = createDiagnosticsPrometheusExporter();
|
|
1649
1660
|
var diagnostics_prometheus_default = definePluginEntry({
|
|
1650
1661
|
id: "diagnostics-prometheus",
|
|
@@ -1661,4 +1672,5 @@ var diagnostics_prometheus_default = definePluginEntry({
|
|
|
1661
1672
|
});
|
|
1662
1673
|
}
|
|
1663
1674
|
});
|
|
1675
|
+
//#endregion
|
|
1664
1676
|
export { diagnostics_prometheus_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/diagnostics-prometheus",
|
|
3
|
-
"version": "2026.11.5-beta.
|
|
3
|
+
"version": "2026.11.5-beta.2",
|
|
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.11.5-beta.
|
|
21
|
+
"pluginApi": ">=2026.11.5-beta.2"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.11.5-beta.
|
|
24
|
+
"openclawVersion": "2026.11.5-beta.2"
|
|
25
25
|
},
|
|
26
26
|
"release": {
|
|
27
27
|
"publishToClawHub": true,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"assets/activity.svg"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"openclaw": ">=2026.11.5-beta.
|
|
42
|
+
"openclaw": ">=2026.11.5-beta.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"openclaw": {
|