Disable Sentry in CI, tag environment correctly
Client: VITE_SENTRY_ENVIRONMENT=ci baked in during CI build, disables Sentry and sets 0 sample rates. Server: checks process.env.CI to disable and tag as "ci" environment. Production remains enabled with "production" environment tag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
48c74f16f8
commit
119dc25f5a
5 changed files with 24 additions and 12 deletions
|
|
@ -3,14 +3,17 @@ import { startTransition, StrictMode } from "react";
|
|||
import { hydrateRoot } from "react-dom/client";
|
||||
import { HydratedRouter } from "react-router/dom";
|
||||
|
||||
const sentryEnvironment = import.meta.env.VITE_SENTRY_ENVIRONMENT ??
|
||||
(import.meta.env.PROD ? "production" : "development");
|
||||
|
||||
Sentry.init({
|
||||
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
||||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
||||
environment: import.meta.env.PROD ? "production" : "development",
|
||||
tracesSampleRate: 0.1,
|
||||
environment: sentryEnvironment,
|
||||
tracesSampleRate: sentryEnvironment === "ci" ? 0 : 0.1,
|
||||
replaysSessionSampleRate: 0,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
enabled: import.meta.env.PROD,
|
||||
replaysOnErrorSampleRate: sentryEnvironment === "ci" ? 0 : 1.0,
|
||||
enabled: import.meta.env.PROD && sentryEnvironment !== "ci",
|
||||
});
|
||||
|
||||
startTransition(() => {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@ import { isbot } from "isbot";
|
|||
import type { RenderToPipeableStreamOptions } from "react-dom/server";
|
||||
import { renderToPipeableStream } from "react-dom/server";
|
||||
|
||||
const sentryEnvironment = process.env.CI ? "ci" : (process.env.NODE_ENV ?? "development");
|
||||
|
||||
Sentry.init({
|
||||
dsn: "https://a32ffcc575d34be072e91b20f247eeee@o4509530546634752.ingest.de.sentry.io/4509530555547728",
|
||||
release: process.env.SENTRY_RELEASE,
|
||||
environment: process.env.NODE_ENV ?? "development",
|
||||
environment: sentryEnvironment,
|
||||
tracesSampleRate: 0.1,
|
||||
enabled: process.env.NODE_ENV === "production",
|
||||
enabled: process.env.NODE_ENV === "production" && !process.env.CI,
|
||||
});
|
||||
|
||||
export const streamTimeout = 5_000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue