mirror of https://github.com/openclaw/openclaw.git
Plugins: internalize diagnostics OTel imports
This commit is contained in:
parent
ff19ae1768
commit
8124253cdf
|
|
@ -0,0 +1 @@
|
|||
export * from "openclaw/plugin-sdk/diagnostics-otel";
|
||||
|
|
@ -98,18 +98,16 @@ vi.mock("@opentelemetry/semantic-conventions", () => ({
|
|||
ATTR_SERVICE_NAME: "service.name",
|
||||
}));
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/diagnostics-otel", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/diagnostics-otel")>(
|
||||
"openclaw/plugin-sdk/diagnostics-otel",
|
||||
);
|
||||
vi.mock("../api.js", async () => {
|
||||
const actual = await vi.importActual<typeof import("../api.js")>("../api.js");
|
||||
return {
|
||||
...actual,
|
||||
registerLogTransport: registerLogTransportMock,
|
||||
};
|
||||
});
|
||||
|
||||
import type { OpenClawPluginServiceContext } from "openclaw/plugin-sdk/diagnostics-otel";
|
||||
import { emitDiagnosticEvent } from "openclaw/plugin-sdk/diagnostics-otel";
|
||||
import type { OpenClawPluginServiceContext } from "../api.js";
|
||||
import { emitDiagnosticEvent } from "../api.js";
|
||||
import { createDiagnosticsOtelService } from "./service.js";
|
||||
|
||||
const OTEL_TEST_STATE_DIR = "/tmp/openclaw-diagnostics-otel-test";
|
||||
|
|
|
|||
|
|
@ -9,15 +9,8 @@ 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/diagnostics-otel";
|
||||
import {
|
||||
onDiagnosticEvent,
|
||||
redactSensitiveText,
|
||||
registerLogTransport,
|
||||
} from "openclaw/plugin-sdk/diagnostics-otel";
|
||||
import type { DiagnosticEventPayload, OpenClawPluginService } from "../api.js";
|
||||
import { onDiagnosticEvent, redactSensitiveText, registerLogTransport } from "../api.js";
|
||||
|
||||
const DEFAULT_SERVICE_NAME = "openclaw";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue