@openclaw/diagnostics-otel 2026.5.22 → 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
@@ -15,15 +15,25 @@ import { registerUnhandledRejectionHandler } from "openclaw/plugin-sdk/runtime-e
15
15
  const DEFAULT_SERVICE_NAME = "openclaw";
16
16
  const DROPPED_OTEL_ATTRIBUTE_KEYS = new Set([
17
17
  "openclaw.callId",
18
+ "openclaw.call_id",
18
19
  "openclaw.chatId",
20
+ "openclaw.chat_id",
19
21
  "openclaw.messageId",
22
+ "openclaw.message_id",
20
23
  "openclaw.parentSpanId",
24
+ "openclaw.parent_span_id",
21
25
  "openclaw.runId",
26
+ "openclaw.run_id",
22
27
  "openclaw.sessionId",
28
+ "openclaw.session_id",
23
29
  "openclaw.sessionKey",
30
+ "openclaw.session_key",
24
31
  "openclaw.spanId",
32
+ "openclaw.span_id",
25
33
  "openclaw.toolCallId",
26
- "openclaw.traceId"
34
+ "openclaw.tool_call_id",
35
+ "openclaw.traceId",
36
+ "openclaw.trace_id"
27
37
  ]);
28
38
  const LOW_CARDINALITY_VALUE_RE = /^[A-Za-z0-9_.:-]{1,120}$/u;
29
39
  const MAX_OTEL_CONTENT_ATTRIBUTE_CHARS = 4 * 1024;
@@ -627,6 +637,10 @@ function createDiagnosticsOtelService() {
627
637
  unit: "1",
628
638
  description: "Detected repetitive tool-call loop events"
629
639
  });
640
+ const skillUsedCounter = meter.createCounter("openclaw.skill.used", {
641
+ unit: "1",
642
+ description: "Skills used by agent runs"
643
+ });
630
644
  const modelCallDurationHistogram = meter.createHistogram("openclaw.model_call.duration_ms", {
631
645
  unit: "ms",
632
646
  description: "Model call duration"
@@ -1371,9 +1385,32 @@ function createDiagnosticsOtelService() {
1371
1385
  };
1372
1386
  const toolExecutionBaseAttrs = (evt) => ({
1373
1387
  "openclaw.toolName": evt.toolName,
1388
+ "openclaw.tool.source": lowCardinalityAttr(evt.toolSource, "core"),
1374
1389
  "gen_ai.tool.name": evt.toolName,
1390
+ ...evt.toolOwner ? { "openclaw.tool.owner": lowCardinalityAttr(evt.toolOwner) } : {},
1375
1391
  ...paramsSummaryAttrs(evt.paramsSummary)
1376
1392
  });
1393
+ const skillUsedAttrs = (evt) => ({
1394
+ "openclaw.skill.name": lowCardinalityAttr(evt.skillName, "skill"),
1395
+ "openclaw.skill.source": lowCardinalityAttr(evt.skillSource),
1396
+ "openclaw.skill.activation": lowCardinalityAttr(evt.activation),
1397
+ ...evt.agentId ? { "openclaw.agent": lowCardinalityAttr(evt.agentId) } : {},
1398
+ ...evt.toolName ? { "openclaw.toolName": lowCardinalityAttr(evt.toolName, "tool") } : {}
1399
+ });
1400
+ const recordSkillUsed = (evt, metadata) => {
1401
+ if (!metadata.trusted) return;
1402
+ const attrs = skillUsedAttrs(evt);
1403
+ skillUsedCounter.add(1, attrs);
1404
+ if (!tracesEnabled) return;
1405
+ const spanAttrs = { ...attrs };
1406
+ addRunAttrs(spanAttrs, evt);
1407
+ const span = spanWithDuration("openclaw.skill.used", spanAttrs, 0, {
1408
+ parentContext: activeTrustedParentContext(evt, metadata),
1409
+ endTimeMs: evt.ts
1410
+ });
1411
+ setSpanAttrs(span, spanAttrs);
1412
+ span.end(evt.ts);
1413
+ };
1377
1414
  const recordToolExecutionStarted = (evt, metadata) => {
1378
1415
  if (!tracesEnabled || !metadata.trusted) return;
1379
1416
  trackTrustedSpan(evt, metadata, spanWithDuration("openclaw.tool.execution", toolExecutionBaseAttrs(evt), void 0, {
@@ -1382,10 +1419,7 @@ function createDiagnosticsOtelService() {
1382
1419
  }));
1383
1420
  };
1384
1421
  const recordToolExecutionCompleted = (evt, metadata) => {
1385
- const attrs = {
1386
- "openclaw.toolName": evt.toolName,
1387
- ...paramsSummaryAttrs(evt.paramsSummary)
1388
- };
1422
+ const attrs = toolExecutionBaseAttrs(evt);
1389
1423
  toolExecutionDurationHistogram.record(evt.durationMs, attrs);
1390
1424
  if (!tracesEnabled) return;
1391
1425
  const spanAttrs = { ...toolExecutionBaseAttrs(evt) };
@@ -1400,9 +1434,8 @@ function createDiagnosticsOtelService() {
1400
1434
  };
1401
1435
  const recordToolExecutionError = (evt, metadata) => {
1402
1436
  const attrs = {
1403
- "openclaw.toolName": evt.toolName,
1404
- "openclaw.errorCategory": lowCardinalityAttr(evt.errorCategory, "other"),
1405
- ...paramsSummaryAttrs(evt.paramsSummary)
1437
+ ...toolExecutionBaseAttrs(evt),
1438
+ "openclaw.errorCategory": lowCardinalityAttr(evt.errorCategory, "other")
1406
1439
  };
1407
1440
  toolExecutionDurationHistogram.record(evt.durationMs, attrs);
1408
1441
  if (!tracesEnabled) return;
@@ -1639,6 +1672,9 @@ function createDiagnosticsOtelService() {
1639
1672
  case "tool.execution.blocked":
1640
1673
  recordToolExecutionBlocked(evt, metadata);
1641
1674
  return;
1675
+ case "skill.used":
1676
+ recordSkillUsed(evt, metadata);
1677
+ return;
1642
1678
  case "exec.process.completed":
1643
1679
  recordExecProcessCompleted(evt);
1644
1680
  return;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/diagnostics-otel",
3
- "version": "2026.5.22",
3
+ "version": "2026.5.24-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/diagnostics-otel",
9
- "version": "2026.5.22",
9
+ "version": "2026.5.24-beta.1",
10
10
  "dependencies": {
11
11
  "@opentelemetry/api": "1.9.1",
12
12
  "@opentelemetry/api-logs": "0.218.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/diagnostics-otel",
3
- "version": "2026.5.22",
3
+ "version": "2026.5.24-beta.1",
4
4
  "description": "OpenClaw diagnostics OpenTelemetry exporter",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,10 +31,10 @@
31
31
  "minHostVersion": ">=2026.4.25"
32
32
  },
33
33
  "compat": {
34
- "pluginApi": ">=2026.5.22"
34
+ "pluginApi": ">=2026.5.24-beta.1"
35
35
  },
36
36
  "build": {
37
- "openclawVersion": "2026.5.22"
37
+ "openclawVersion": "2026.5.24-beta.1"
38
38
  },
39
39
  "release": {
40
40
  "publishToClawHub": true,
@@ -50,7 +50,7 @@
50
50
  "npm-shrinkwrap.json"
51
51
  ],
52
52
  "peerDependencies": {
53
- "openclaw": ">=2026.5.22"
53
+ "openclaw": ">=2026.5.24-beta.1"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "openclaw": {