feat: add OpenTelemetry observability, Faro frontend monitoring, remove legacy Next.js app

- Add OpenTelemetry SDK with tracing, metrics, and OTLP export for API and worker
- Integrate Grafana Faro for frontend real-user monitoring
- Instrument health checks, database, Bull queues, and HTTP exception filter
- Add Grafana dashboard JSON for service overview
- Remove deprecated apps/web-nj (Next.js) — fully replaced by Vite+React frontend
- Update nginx config with OTEL collector proxy
- Minor UI fixes in schema viewer, category components, and subscription flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sase Dev
2026-02-16 17:20:49 +00:00
parent 87d8eea298
commit dcbeb83ccc
113 changed files with 2745 additions and 7351 deletions

View File

@@ -0,0 +1,20 @@
import "dotenv/config"; // Load env vars before checking OTEL_ENABLED
import { isOtelEnabled } from "./index";
import type { NodeSDK } from "@opentelemetry/sdk-node";
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 };