From 56d98a50cfff2aee9b8e36bde12b9537783b7692 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Wed, 4 Mar 2026 01:20:03 -0500 Subject: [PATCH] Extensions: migrate diagnostics-otel plugin-sdk imports --- extensions/diagnostics-otel/src/service.test.ts | 10 ++++++---- extensions/diagnostics-otel/src/service.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/extensions/diagnostics-otel/src/service.test.ts b/extensions/diagnostics-otel/src/service.test.ts index ab3fb57e15a..031922f2c5d 100644 --- a/extensions/diagnostics-otel/src/service.test.ts +++ b/extensions/diagnostics-otel/src/service.test.ts @@ -98,16 +98,18 @@ vi.mock("@opentelemetry/semantic-conventions", () => ({ ATTR_SERVICE_NAME: "service.name", })); -vi.mock("openclaw/plugin-sdk", async () => { - const actual = await vi.importActual("openclaw/plugin-sdk"); +vi.mock("openclaw/plugin-sdk/compat", async () => { + const actual = await vi.importActual( + "openclaw/plugin-sdk/compat", + ); return { ...actual, registerLogTransport: registerLogTransportMock, }; }); -import type { OpenClawPluginServiceContext } from "openclaw/plugin-sdk"; -import { emitDiagnosticEvent } from "openclaw/plugin-sdk"; +import type { OpenClawPluginServiceContext } from "openclaw/plugin-sdk/compat"; +import { emitDiagnosticEvent } from "openclaw/plugin-sdk/compat"; import { createDiagnosticsOtelService } from "./service.js"; const OTEL_TEST_STATE_DIR = "/tmp/openclaw-diagnostics-otel-test"; diff --git a/extensions/diagnostics-otel/src/service.ts b/extensions/diagnostics-otel/src/service.ts index be9a547963f..a63620a3e9a 100644 --- a/extensions/diagnostics-otel/src/service.ts +++ b/extensions/diagnostics-otel/src/service.ts @@ -9,8 +9,12 @@ import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics"; import { NodeSDK } from "@opentelemetry/sdk-node"; import { ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-base"; import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions"; -import type { DiagnosticEventPayload, OpenClawPluginService } from "openclaw/plugin-sdk"; -import { onDiagnosticEvent, redactSensitiveText, registerLogTransport } from "openclaw/plugin-sdk"; +import type { DiagnosticEventPayload, OpenClawPluginService } from "openclaw/plugin-sdk/compat"; +import { + onDiagnosticEvent, + redactSensitiveText, + registerLogTransport, +} from "openclaw/plugin-sdk/compat"; const DEFAULT_SERVICE_NAME = "openclaw";