mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:17:40 +00:00
Plugins/diagnostics-otel: migrate to scoped plugin-sdk imports
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/diagnostics-otel";
|
||||||
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core";
|
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/diagnostics-otel";
|
||||||
import { createDiagnosticsOtelService } from "./src/service.js";
|
import { createDiagnosticsOtelService } from "./src/service.js";
|
||||||
|
|
||||||
const plugin = {
|
const plugin = {
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ vi.mock("@opentelemetry/semantic-conventions", () => ({
|
|||||||
ATTR_SERVICE_NAME: "service.name",
|
ATTR_SERVICE_NAME: "service.name",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("openclaw/plugin-sdk/compat", async () => {
|
vi.mock("openclaw/plugin-sdk/diagnostics-otel", async () => {
|
||||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/compat")>(
|
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/diagnostics-otel")>(
|
||||||
"openclaw/plugin-sdk/compat",
|
"openclaw/plugin-sdk/diagnostics-otel",
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
...actual,
|
...actual,
|
||||||
@@ -108,8 +108,8 @@ vi.mock("openclaw/plugin-sdk/compat", async () => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
import type { OpenClawPluginServiceContext } from "openclaw/plugin-sdk/compat";
|
import type { OpenClawPluginServiceContext } from "openclaw/plugin-sdk/diagnostics-otel";
|
||||||
import { emitDiagnosticEvent } from "openclaw/plugin-sdk/compat";
|
import { emitDiagnosticEvent } from "openclaw/plugin-sdk/diagnostics-otel";
|
||||||
import { createDiagnosticsOtelService } from "./service.js";
|
import { createDiagnosticsOtelService } from "./service.js";
|
||||||
|
|
||||||
const OTEL_TEST_STATE_DIR = "/tmp/openclaw-diagnostics-otel-test";
|
const OTEL_TEST_STATE_DIR = "/tmp/openclaw-diagnostics-otel-test";
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|||||||
import { NodeSDK } from "@opentelemetry/sdk-node";
|
import { NodeSDK } from "@opentelemetry/sdk-node";
|
||||||
import { ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-base";
|
import { ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-base";
|
||||||
import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
||||||
import type { DiagnosticEventPayload, OpenClawPluginService } from "openclaw/plugin-sdk/compat";
|
import type {
|
||||||
|
DiagnosticEventPayload,
|
||||||
|
OpenClawPluginService,
|
||||||
|
} from "openclaw/plugin-sdk/diagnostics-otel";
|
||||||
import {
|
import {
|
||||||
onDiagnosticEvent,
|
onDiagnosticEvent,
|
||||||
redactSensitiveText,
|
redactSensitiveText,
|
||||||
registerLogTransport,
|
registerLogTransport,
|
||||||
} from "openclaw/plugin-sdk/compat";
|
} from "openclaw/plugin-sdk/diagnostics-otel";
|
||||||
|
|
||||||
const DEFAULT_SERVICE_NAME = "openclaw";
|
const DEFAULT_SERVICE_NAME = "openclaw";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user