@openclaw/diagnostics-otel 2026.5.3-beta.4 → 2026.5.4-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.
Files changed (2) hide show
  1. package/dist/index.js +13 -16
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -14,6 +14,8 @@ import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
14
14
  const DEFAULT_SERVICE_NAME = "openclaw";
15
15
  const DROPPED_OTEL_ATTRIBUTE_KEYS = new Set([
16
16
  "openclaw.callId",
17
+ "openclaw.chatId",
18
+ "openclaw.messageId",
17
19
  "openclaw.parentSpanId",
18
20
  "openclaw.runId",
19
21
  "openclaw.sessionId",
@@ -785,19 +787,17 @@ function createDiagnosticsOtelService() {
785
787
  };
786
788
  const recordWebhookProcessed = (evt) => {
787
789
  const attrs = {
788
- "openclaw.channel": evt.channel ?? "unknown",
789
- "openclaw.webhook": evt.updateType ?? "unknown"
790
+ "openclaw.channel": lowCardinalityAttr(evt.channel),
791
+ "openclaw.webhook": lowCardinalityAttr(evt.updateType)
790
792
  };
791
793
  if (typeof evt.durationMs === "number") webhookDurationHistogram.record(evt.durationMs, attrs);
792
794
  if (!tracesEnabled) return;
793
- const spanAttrs = { ...attrs };
794
- if (evt.chatId !== void 0) spanAttrs["openclaw.chatId"] = String(evt.chatId);
795
- spanWithDuration("openclaw.webhook.processed", spanAttrs, evt.durationMs).end();
795
+ spanWithDuration("openclaw.webhook.processed", { ...attrs }, evt.durationMs).end();
796
796
  };
797
797
  const recordWebhookError = (evt) => {
798
798
  const attrs = {
799
- "openclaw.channel": evt.channel ?? "unknown",
800
- "openclaw.webhook": evt.updateType ?? "unknown"
799
+ "openclaw.channel": lowCardinalityAttr(evt.channel),
800
+ "openclaw.webhook": lowCardinalityAttr(evt.updateType)
801
801
  };
802
802
  webhookErrorCounter.add(1, attrs);
803
803
  if (!tracesEnabled) return;
@@ -806,7 +806,6 @@ function createDiagnosticsOtelService() {
806
806
  ...attrs,
807
807
  "openclaw.error": redactedError
808
808
  };
809
- if (evt.chatId !== void 0) spanAttrs["openclaw.chatId"] = String(evt.chatId);
810
809
  const span = tracer.startSpan("openclaw.webhook.error", { attributes: spanAttrs });
811
810
  span.setStatus({
812
811
  code: SpanStatusCode.ERROR,
@@ -816,24 +815,22 @@ function createDiagnosticsOtelService() {
816
815
  };
817
816
  const recordMessageQueued = (evt) => {
818
817
  const attrs = {
819
- "openclaw.channel": evt.channel ?? "unknown",
820
- "openclaw.source": evt.source ?? "unknown"
818
+ "openclaw.channel": lowCardinalityAttr(evt.channel),
819
+ "openclaw.source": lowCardinalityAttr(evt.source)
821
820
  };
822
821
  messageQueuedCounter.add(1, attrs);
823
822
  if (typeof evt.queueDepth === "number") queueDepthHistogram.record(evt.queueDepth, attrs);
824
823
  };
825
824
  const recordMessageProcessed = (evt) => {
826
825
  const attrs = {
827
- "openclaw.channel": evt.channel ?? "unknown",
826
+ "openclaw.channel": lowCardinalityAttr(evt.channel),
828
827
  "openclaw.outcome": evt.outcome ?? "unknown"
829
828
  };
830
829
  messageProcessedCounter.add(1, attrs);
831
830
  if (typeof evt.durationMs === "number") messageDurationHistogram.record(evt.durationMs, attrs);
832
831
  if (!tracesEnabled) return;
833
832
  const spanAttrs = { ...attrs };
834
- if (evt.chatId !== void 0) spanAttrs["openclaw.chatId"] = String(evt.chatId);
835
- if (evt.messageId !== void 0) spanAttrs["openclaw.messageId"] = String(evt.messageId);
836
- if (evt.reason) spanAttrs["openclaw.reason"] = redactSensitiveText(evt.reason);
833
+ if (evt.reason) spanAttrs["openclaw.reason"] = lowCardinalityAttr(evt.reason, "unknown");
837
834
  const span = spanWithDuration("openclaw.message.processed", spanAttrs, evt.durationMs);
838
835
  if (evt.outcome === "error" && evt.error) span.setStatus({
839
836
  code: SpanStatusCode.ERROR,
@@ -842,8 +839,8 @@ function createDiagnosticsOtelService() {
842
839
  span.end();
843
840
  };
844
841
  const messageDeliveryAttrs = (evt) => ({
845
- "openclaw.channel": evt.channel,
846
- "openclaw.delivery.kind": evt.deliveryKind
842
+ "openclaw.channel": lowCardinalityAttr(evt.channel),
843
+ "openclaw.delivery.kind": lowCardinalityAttr(evt.deliveryKind, "other")
847
844
  });
848
845
  const recordMessageDeliveryStarted = (evt) => {
849
846
  messageDeliveryStartedCounter.add(1, messageDeliveryAttrs(evt));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/diagnostics-otel",
3
- "version": "2026.5.3-beta.4",
3
+ "version": "2026.5.4-beta.1",
4
4
  "description": "OpenClaw diagnostics OpenTelemetry exporter",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,10 +34,10 @@
34
34
  "minHostVersion": ">=2026.4.25"
35
35
  },
36
36
  "compat": {
37
- "pluginApi": ">=2026.5.3-beta.4"
37
+ "pluginApi": ">=2026.5.4-beta.1"
38
38
  },
39
39
  "build": {
40
- "openclawVersion": "2026.5.3-beta.4"
40
+ "openclawVersion": "2026.5.4-beta.1"
41
41
  },
42
42
  "release": {
43
43
  "publishToClawHub": true,
@@ -52,7 +52,7 @@
52
52
  "openclaw.plugin.json"
53
53
  ],
54
54
  "peerDependencies": {
55
- "openclaw": ">=2026.5.3-beta.4"
55
+ "openclaw": ">=2026.5.4-beta.1"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "openclaw": {