Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/admin/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_ADMIN,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: !!env.NEXT_PUBLIC_SENTRY_DSN_ADMIN,
tracesSampleRate: 0.05,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/admin/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_ADMIN,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: !!env.NEXT_PUBLIC_SENTRY_DSN_ADMIN,
tracesSampleRate: 0.05,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/admin/src/instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_ADMIN,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: !!env.NEXT_PUBLIC_SENTRY_DSN_ADMIN,
tracesSampleRate: 0.05,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
sendDefaultPii: true,
Expand Down
1 change: 0 additions & 1 deletion apps/api/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_API,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampler: ({ name }) => (name.includes("/api/auth/") ? 0 : 0.05),
sendDefaultPii: true,
debug: false,
});
14 changes: 5 additions & 9 deletions apps/api/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_API,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
// Per-route sampling. /api/auth/* is session/JWT polling from every
// client — 87% of api traffic (~600M req/30d) with no diagnostic value,
// and at 10% it alone blew the span quota 16x. Webhooks/jobs are low
// volume and each trace is useful; the rest gets a working sample.
tracesSampler: ({ name }) => {
if (name.includes("/api/auth/")) return 0;
if (name.includes("/webhook") || name.includes("/jobs/")) return 0.25;
return 0.05;
},
// No tracesSampleRate or tracesSampler on purpose: the SDK treats a rate of
// 0 as "tracing on, sample nothing" and still records every span whose
// parent was sampled, and a sampler here was storing a flat 5% of ~20M
// requests a day (~19M spans, 115x the org quota). Omitting both disables
// spans outright.
sendDefaultPii: true,
debug: false,
});
17 changes: 9 additions & 8 deletions apps/desktop/src/main/lib/auto-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,24 @@ export type { AutoUpdateStatusEvent } from "shared/auto-update";

export const autoUpdateEmitter = new EventEmitter();

// Network errors that don't need to be shown to the user
// These are transient/expected and will resolve on retry
// Network errors that don't need to be shown to the user or reported: they are
// transient and the next check retries. Chromium names every transport failure
// net::ERR_* (timeouts, HTTP/2 resets, a laptop suspending mid-download, a
// proxy's certificate), and none of them is a defect in the feed or artifact —
// an enumerated list was reporting ~800 of the unlisted ones a day.
const SILENT_ERROR_PATTERNS = [
"net::ERR_INTERNET_DISCONNECTED",
"net::ERR_NETWORK_CHANGED",
"net::ERR_CONNECTION_REFUSED",
"net::ERR_NAME_NOT_RESOLVED",
"net::ERR_CONNECTION_TIMED_OUT",
"net::ERR_CONNECTION_RESET",
"net::ERR_",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
"ENOTFOUND",
"ETIMEDOUT",
"ECONNREFUSED",
"ECONNRESET",
];

// Certificate failures are the exception: a proxy that rewrites TLS is
// permanent, so the user needs to see why updates never arrive.
function isNetworkError(error: Error | string): boolean {
const message = typeof error === "string" ? error : error.message;
if (message.includes("net::ERR_CERT_")) return false;
return SILENT_ERROR_PATTERNS.some((pattern) => message.includes(pattern));
}

Expand Down
1 change: 0 additions & 1 deletion apps/desktop/src/main/lib/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function initSentry(): void {
Sentry.init({
dsn: env.SENTRY_DSN_DESKTOP,
environment: env.NODE_ENV,
tracesSampleRate: 0,
sendDefaultPii: false,
// One machine repeating one failure should not crowd out everyone
// else's rare ones, nor spend the org's quota getting there.
Expand Down
1 change: 0 additions & 1 deletion apps/desktop/src/renderer/lib/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export async function initSentry(): Promise<void> {
Sentry.init({
dsn: env.SENTRY_DSN_DESKTOP,
environment: env.NODE_ENV,
tracesSampleRate: 0,
ignoreErrors: SENTRY_IGNORE_ERRORS,
// tRPC failures are reported by the main-process middleware with full
// server context; renderer copies (unhandled query/mutation promises)
Expand Down
1 change: 0 additions & 1 deletion apps/docs/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_DOCS,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.01,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/docs/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_DOCS,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.01,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/docs/src/instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_DOCS,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.01,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
sendDefaultPii: true,
Expand Down
1 change: 0 additions & 1 deletion apps/marketing/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_MARKETING,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.01,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/marketing/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_MARKETING,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.01,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/marketing/src/instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ async function initSentry() {
dsn: env.NEXT_PUBLIC_SENTRY_DSN_MARKETING,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.01,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
sendDefaultPii: true,
Expand Down
1 change: 0 additions & 1 deletion apps/mobile/lib/sentry/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export function initSentry() {
Sentry.init({
dsn: env.EXPO_PUBLIC_SENTRY_DSN_MOBILE,
environment: env.EXPO_PUBLIC_SENTRY_ENVIRONMENT,
tracesSampleRate: 0,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
sendDefaultPii: false,
Expand Down
3 changes: 2 additions & 1 deletion apps/relay/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,10 @@ function isPeerGone(message: string): boolean {

// Exceptions only — console/breadcrumb capture stays off: retaining every log
// line is a memory leak at relay volume. No-op until SENTRY_DSN is set.
// No tracesSampleRate either: 0 keeps tracing enabled and inherits the caller's
// sampling decision, which stored 165k /presence spans a day from api traces.
const sentryOptions = (env: RelayEnv): Sentry.CloudflareOptions => ({
dsn: env.SENTRY_DSN,
tracesSampleRate: 0,
sendDefaultPii: false,
integrations: (defaults) =>
defaults.filter((integration) => integration.name !== "Console"),
Expand Down
1 change: 0 additions & 1 deletion apps/usercontent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ app.notFound(() => notFound());
// Exceptions only; no-op until SENTRY_DSN is set.
const sentryOptions = (env: UsercontentEnv): Sentry.CloudflareOptions => ({
dsn: env.SENTRY_DSN,
tracesSampleRate: 0,
sendDefaultPii: false,
integrations: (defaults) =>
defaults.filter((integration) => integration.name !== "Console"),
Expand Down
1 change: 0 additions & 1 deletion apps/web/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_WEB,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.05,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/web/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_WEB,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.05,
sendDefaultPii: true,
debug: false,
});
1 change: 0 additions & 1 deletion apps/web/src/instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Sentry.init({
dsn: env.NEXT_PUBLIC_SENTRY_DSN_WEB,
environment: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
enabled: env.NEXT_PUBLIC_SENTRY_ENVIRONMENT === "production",
tracesSampleRate: 0.05,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
sendDefaultPii: true,
Expand Down
1 change: 0 additions & 1 deletion packages/host-service/src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function initSentry(options: { organizationId?: string }): void {
dsn,
release: process.env.HOST_SERVICE_SENTRY_RELEASE,
environment: process.env.HOST_SERVICE_SENTRY_ENVIRONMENT,
tracesSampleRate: 0,
// A host that fails once usually fails in a loop: git.getStatus alone
// sent 135k copies of one `spawn EBADF` from seven machines last month.
beforeSend: throttleRepeats,
Expand Down
Loading