feat: Add Sentry
parent
31f3d9778e
commit
33bceb04f6
|
@ -3,6 +3,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|||
const os = require("os");
|
||||
const englishTranslation = require("./public/static/locales/en/common.json");
|
||||
const { withAxiom } = require("next-axiom");
|
||||
const { withSentryConfig } = require("@sentry/nextjs");
|
||||
const { version } = require("./package.json");
|
||||
const { i18n } = require("./next-i18next.config");
|
||||
const {
|
||||
|
@ -92,6 +93,11 @@ if (process.env.ANALYZE === "true") {
|
|||
}
|
||||
|
||||
plugins.push(withAxiom);
|
||||
|
||||
if (!!process.env.NEXT_PUBLIC_SENTRY_DSN) {
|
||||
plugins.push(withSentryConfig);
|
||||
}
|
||||
|
||||
const matcherConfigRootPath = {
|
||||
has: [
|
||||
{
|
||||
|
@ -149,6 +155,10 @@ const nextConfig = {
|
|||
localeDetection: false,
|
||||
},
|
||||
productionBrowserSourceMaps: true,
|
||||
sentry: {
|
||||
autoInstrumentServerFunctions: true,
|
||||
hideSourceMaps: true,
|
||||
},
|
||||
/* We already do type check on GH actions */
|
||||
typescript: {
|
||||
ignoreBuildErrors: !!process.env.CI,
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { wrapApiHandlerWithSentry } from "@sentry/nextjs";
|
||||
|
||||
import { createNextApiHandler } from "@calcom/trpc/server/createNextApiHandler";
|
||||
import { slotsRouter } from "@calcom/trpc/server/routers/viewer/slots/_router";
|
||||
|
||||
export default createNextApiHandler(slotsRouter);
|
||||
export default wrapApiHandlerWithSentry(createNextApiHandler(slotsRouter, "/api/trpc/slots/[trpc]"));
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
import * as Sentry from "@sentry/nextjs";
|
||||
|
||||
Sentry.init({
|
||||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
tracesSampleRate: 0,
|
||||
});
|
|
@ -26,6 +26,7 @@
|
|||
"outputs": [".next/**"],
|
||||
"env": [
|
||||
"NEXT_PUBLIC_IS_E2E",
|
||||
"NEXT_PUBLIC_SENTRY_DSN",
|
||||
"NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE_MONTHLY",
|
||||
"NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRODUCT_ID",
|
||||
"NEXT_PUBLIC_STRIPE_PUBLIC_KEY",
|
||||
|
|
Loading…
Reference in New Issue