Run 'biome check --fix' on apps/api/src and apps/web/src to clear the safe-fixable lint backlog (151 files: parseInt → Number.parseInt, isNaN → Number.isNaN, organize imports, etc.). 769 errors remain that require manual changes (mostly noExplicitAny). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
763 B
TypeScript
21 lines
763 B
TypeScript
import "dotenv/config"; // Load env vars before checking OTEL_ENABLED
|
|
import type { NodeSDK } from "@opentelemetry/sdk-node";
|
|
import { isOtelEnabled } from "./index";
|
|
|
|
let sdk: NodeSDK | null = null;
|
|
|
|
if (isOtelEnabled) {
|
|
const { createNodeSDK } = require("./sdk-factory") as typeof import("./sdk-factory");
|
|
const { HttpInstrumentation } = require("@opentelemetry/instrumentation-http");
|
|
const { IORedisInstrumentation } = require("@opentelemetry/instrumentation-ioredis");
|
|
|
|
sdk = createNodeSDK({
|
|
serviceName: process.env.OTEL_SERVICE_NAME || "sase-worker",
|
|
instrumentations: [new HttpInstrumentation(), new IORedisInstrumentation()],
|
|
});
|
|
} else {
|
|
console.log("[worker][otel] Telemetry disabled (OTEL_ENABLED !== 'true')");
|
|
}
|
|
|
|
export { sdk };
|