Skip to content

Commit

Permalink
Merge branch 'main' into setup-chromatic-turbosnap
Browse files Browse the repository at this point in the history
  • Loading branch information
KenzoBenzo authored May 9, 2024
2 parents 2d24222 + 49cda79 commit 61ba1c9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
31 changes: 25 additions & 6 deletions packages/ui/docs-bundle/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@

import * as Sentry from "@sentry/nextjs";

const sentryEnv = process?.env.NEXT_PUBLIC_APPLICATION_ENVIRONMENT ?? "dev";

Sentry.init({
dsn: "https://216ad381a8f652e036b1833af58627e5@o4507138224160768.ingest.us.sentry.io/4507148139495424",
// Do not enable sentry locally
enabled: process.env.NODE_ENV === "production",
environment: process?.env.NEXT_PUBLIC_APPLICATION_ENVIRONMENT ?? "dev",

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Performance Monitoring
tracesSampleRate: sentryEnv === "dev" ? 0.5 : 0.75, // Capture 75% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: sentryEnv === "dev" ? 0.5 : 0.75,

sampleRate: 1.0,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,

// Capture all error replays, but only half all others
replaysOnErrorSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 1.0,
replaysSessionSampleRate: sentryEnv === "dev" ? 0 : 0.5,

autoSessionTracking: true,

Expand All @@ -35,4 +37,21 @@ Sentry.init({
],
// This option is required for capturing headers and cookies.
sendDefaultPii: true,

beforeSend: (event: Sentry.Event, _: Sentry.EventHint): Sentry.Event | null => {
// Filter out events from privategpt
if (event.request?.url?.includes("privategpt")) {
return null;
}
if (
event.tags != null &&
event.tags["url"] != null &&
typeof event.tags["url"] === "string" &&
event.tags["url"].includes("privategpt")
) {
return null;
}

return event;
},
});
10 changes: 8 additions & 2 deletions packages/ui/docs-bundle/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

import * as Sentry from "@sentry/nextjs";

const sentryEnv = process?.env.NEXT_PUBLIC_APPLICATION_ENVIRONMENT ?? "dev";

Sentry.init({
// Do not enable sentry locally
enabled: process.env.NODE_ENV === "production",
dsn: "https://216ad381a8f652e036b1833af58627e5@o4507138224160768.ingest.us.sentry.io/4507148139495424",

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Performance Monitoring
tracesSampleRate: sentryEnv === "dev" ? 0.5 : 0.75, // Capture 75% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: sentryEnv === "dev" ? 0.5 : 0.75,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
Expand Down
15 changes: 9 additions & 6 deletions packages/ui/docs-bundle/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@

import * as Sentry from "@sentry/nextjs";

const sentryEnv = process?.env.NEXT_PUBLIC_APPLICATION_ENVIRONMENT ?? "dev";

Sentry.init({
// Do not enable sentry locally
enabled: process.env.NODE_ENV === "production",
dsn: "https://216ad381a8f652e036b1833af58627e5@o4507138224160768.ingest.us.sentry.io/4507148139495424",

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Performance Monitoring
tracesSampleRate: sentryEnv === "dev" ? 0.5 : 0.75, // Capture 75% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: sentryEnv === "dev" ? 0.5 : 0.75,

// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
environment: process?.env.NEXT_PUBLIC_APPLICATION_ENVIRONMENT ?? "dev",

// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: process.env.NODE_ENV === 'development',
environment: sentryEnv,
});
4 changes: 2 additions & 2 deletions servers/fdr/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Sentry.init({
nodeProfilingIntegration(),
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
tracesSampleRate: config.applicationEnvironment == "prod" ? 0.75 : 0.5, // Capture 75% of the transactions
// Set sampling rate for profiling - this is relative to tracesSampleRate
profilesSampleRate: 1.0,
profilesSampleRate: config.applicationEnvironment == "prod" ? 0.75 : 0.5,
environment: config.applicationEnvironment,
maxValueLength: 1000,
enabled: config.applicationEnvironment === "dev" || config.applicationEnvironment == "prod",
Expand Down

0 comments on commit 61ba1c9

Please sign in to comment.