diff --git a/apps/web-next/src/server/bind-production.test.ts b/apps/web-next/src/server/bind-production.test.ts index 184ad11..5f42eff 100644 --- a/apps/web-next/src/server/bind-production.test.ts +++ b/apps/web-next/src/server/bind-production.test.ts @@ -14,9 +14,12 @@ vi.mock("@repo/navigation/di/bind-dev-seed", () => ({ bindDevSeedNavigation: vi. vi.mock("@repo/media/di/bind-dev-seed", () => ({ bindDevSeedMedia: vi.fn() })); vi.mock("@repo/core-shared/instrumentation", async (importOriginal) => { const actual = await importOriginal(); + const mockedOtel = vi.fn(actual.bindOtelInstrumentation); return { ...actual, - bindSentryInstrumentation: vi.fn(actual.bindSentryInstrumentation), + bindOtelInstrumentation: mockedOtel, + // Deprecated alias — points to same spy so existing assertions still work. + bindSentryInstrumentation: mockedOtel, bindNoopInstrumentation: vi.fn(actual.bindNoopInstrumentation), }; }); diff --git a/apps/web-next/src/server/bind-production.ts b/apps/web-next/src/server/bind-production.ts index 69d2131..d57eb49 100644 --- a/apps/web-next/src/server/bind-production.ts +++ b/apps/web-next/src/server/bind-production.ts @@ -6,7 +6,7 @@ import { getPayload } from "payload"; import config from "@repo/core-cms"; import { bindNoopInstrumentation, - bindSentryInstrumentation, + bindOtelInstrumentation, type ITracer, type ILogger, } from "@repo/core-shared/instrumentation"; @@ -45,7 +45,7 @@ function resolveInstrumentation(): { tracer: ITracer; logger: ILogger } { } const dsn = process.env.WEB_NEXT_SENTRY_DSN; const result = dsn - ? bindSentryInstrumentation(sharedContainer, { dsn, app: "web-next" }) + ? bindOtelInstrumentation(sharedContainer, { dsn, app: "web-next" }) : bindNoopInstrumentation(sharedContainer); resolvedTracer = result.tracer; resolvedLogger = result.logger;