feat(FN-094): add comment line for deployment verification
Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
Some checks failed
Sync dev → Gitea / Mirror dev to Gitea (push) Has been cancelled
- Added a comment line to main.ts for deployment verification purposes
This commit is contained in:
30
apps/api/src/instrument.ts
Normal file
30
apps/api/src/instrument.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// MUST be imported before anything else in main.ts so Sentry can patch modules
|
||||
// before they're loaded. See https://docs.sentry.io/platforms/javascript/guides/nestjs/
|
||||
|
||||
import "dotenv/config";
|
||||
import * as Sentry from "@sentry/nestjs";
|
||||
import { nodeProfilingIntegration } from "@sentry/profiling-node";
|
||||
|
||||
const dsn =
|
||||
process.env.SENTRY_DSN ||
|
||||
"https://931a9c8d2bcc49918e3ba4d11510f910@o4511360959250432.ingest.de.sentry.io/4511360960823376";
|
||||
|
||||
// We ship a custom OpenTelemetry SDK in src/telemetry/tracing.ts. When it's enabled,
|
||||
// Sentry must NOT register its own OTel pipeline or we'd double-instrument
|
||||
// HTTP/Express/Nest. The trade-off: Sentry tracing + profiling rely on its OTel,
|
||||
// so they're effectively disabled when the custom pipeline is on.
|
||||
const customOtelEnabled = process.env.OTEL_ENABLED === "true";
|
||||
|
||||
if (dsn && process.env.NODE_ENV !== "test") {
|
||||
Sentry.init({
|
||||
dsn,
|
||||
environment: process.env.NODE_ENV || "development",
|
||||
sendDefaultPii: true,
|
||||
enableLogs: true,
|
||||
skipOpenTelemetrySetup: customOtelEnabled,
|
||||
integrations: customOtelEnabled ? [] : [nodeProfilingIntegration()],
|
||||
tracesSampleRate: customOtelEnabled ? 0 : 1.0,
|
||||
profileSessionSampleRate: customOtelEnabled ? 0 : 1.0,
|
||||
profileLifecycle: "trace",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user