chore: Lower number of errors sent to Sentry (#21300)
This commit is contained in:
1 parent
df75df7008
commit
f50be6c08b
6 files changed
+11
-10
No files matched your search
@@ -166,6 +166,7 @@ SENTRY_AUTH_TOKEN=
|
||||
NEXT_PUBLIC_SENTRY_DSN=
|
||||
SENTRY_DEBUG=
|
||||
SENTRY_MAX_SPANS=
|
||||
SENTRY_SAMPLE_RATE=
|
||||
SENTRY_TRACES_SAMPLE_RATE=
|
||||
SENTRY_REPLAYS_SESSION_SAMPLE_RATE=
|
||||
SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE=
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as Sentry from "@sentry/nextjs";
|
||||
Sentry.init({
|
||||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
|
||||
sampleRate: parseFloat(process.env.SENTRY_SAMPLE_RATE ?? "1.0") || 1.0,
|
||||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
||||
tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE ?? "0.0") || 0.0,
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as Sentry from "@sentry/nextjs";
|
||||
|
||||
Sentry.init({
|
||||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
|
||||
sampleRate: parseFloat(process.env.SENTRY_SAMPLE_RATE ?? "1.0") || 1.0,
|
||||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
||||
tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE ?? "0.0") || 0.0,
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import * as Sentry from "@sentry/nextjs";
|
||||
Sentry.init({
|
||||
debug: !!process.env.SENTRY_DEBUG,
|
||||
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
||||
sampleRate: parseFloat(process.env.SENTRY_SAMPLE_RATE ?? "1.0") || 1.0,
|
||||
tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE ?? "0.0") || 0.0,
|
||||
integrations: [Sentry.prismaIntegration()],
|
||||
beforeSend(event) {
|
||||
|
||||
@@ -31,17 +31,14 @@ async function postHandler(req: NextApiRequest) {
|
||||
const selectedCalendar = await SelectedCalendarRepository.findFirstByGoogleChannelId(channelId);
|
||||
|
||||
if (!selectedCalendar) {
|
||||
throw new HttpError({
|
||||
statusCode: 200,
|
||||
message: `No selected calendar found for googleChannelId: ${channelId}`,
|
||||
});
|
||||
log.info("postHandler", `No selected calendar found for googleChannelId: ${channelId}`);
|
||||
return { message: "ok" };
|
||||
}
|
||||
const { credential } = selectedCalendar;
|
||||
if (!credential)
|
||||
throw new HttpError({
|
||||
statusCode: 200,
|
||||
message: `No credential found for selected calendar for googleChannelId: ${channelId}`,
|
||||
});
|
||||
if (!credential) {
|
||||
log.info("postHandler", `No credential found for selected calendar for googleChannelId: ${channelId}`);
|
||||
return { message: "ok" };
|
||||
}
|
||||
const { selectedCalendars } = credential;
|
||||
const credentialForCalendarCache = await getCredentialForCalendarCache({ credentialId: credential.id });
|
||||
const calendarServiceForCalendarCache = await getCalendar(credentialForCalendarCache);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
"SENTRY_MAX_SPANS",
|
||||
"SENTRY_ORG",
|
||||
"SENTRY_PROJECT",
|
||||
"SENTRY_SAMPLE_RATE",
|
||||
"SENTRY_TRACES_SAMPLE_RATE",
|
||||
"SENTRY_REPLAYS_SESSION_SAMPLE_RATE",
|
||||
"SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE",
|
||||
|
||||
Reference in new issue
Block a user