21 lines
773 B
TypeScript
21 lines
773 B
TypeScript
/**
|
|
* Copyright (c) 2023-present Plane Software, Inc. and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
import * as Sentry from "@sentry/node";
|
|
import { nodeProfilingIntegration } from "@sentry/profiling-node";
|
|
|
|
export const setupSentry = () => {
|
|
if (process.env.SENTRY_DSN) {
|
|
Sentry.init({
|
|
dsn: process.env.SENTRY_DSN,
|
|
integrations: [Sentry.httpIntegration(), Sentry.expressIntegration(), nodeProfilingIntegration()],
|
|
tracesSampleRate: process.env.SENTRY_TRACES_SAMPLE_RATE ? parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE) : 0.5,
|
|
environment: process.env.SENTRY_ENVIRONMENT || "development",
|
|
release: process.env.APP_VERSION || "v1.0.0",
|
|
sendDefaultPii: true,
|
|
});
|
|
}
|
|
};
|