Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import {init} from '@sentry/browser'
import {featureFlagsIntegration} from '#/logger/sentry/featureFlags'import {dropExpectedNetworkErrors} from '#/logger/sentry/network-errors'import * as env from '#/env'
/* * Web counterpart of ./index.ts. Initializing `@sentry/browser` directly * instead of `@sentry/react-native` keeps the RN SDK layer (native wrapper, * RN tracing, feedback widget, RN integrations - roughly 200KB minified) out * of the web bundle. Options mirror the native setup; RN-only options are * omitted. */init({ enabled: !env.IS_DEV && !!env.SENTRY_DSN, dsn: env.SENTRY_DSN, sendDefaultPii: true, debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production environment: env.ENV, dist: env.BUNDLE_IDENTIFIER, release: env.SENTRY_RELEASE, beforeSend: dropExpectedNetworkErrors, ignoreErrors: [ /* * Unknown internals errors */ `t is not defined`, `Can't find variable: t`, ], /** * Does not affect traces of error events or other logs, just disables * automatically attaching stack traces to events. This helps us group events * and prevents explosions of separate issues. * * @see https://docs.sentry.io/platforms/react-native/configuration/options/#attach-stacktrace */ attachStacktrace: false, sampleRate: env.IS_INTERNAL ? 1.0 : 0.1, /** * Sample rate for performance spans (video playback, video upload). Setting * this also enables the SDK's default stall and slow/frozen frame tracking, * whose measurements attach to every root span. */ tracesSampleRate: env.IS_INTERNAL ? 1.0 : 0.01, /* * The native setup passes `enableAutoSessionTracking: false`. The browser * SDK's equivalent is the BrowserSession default integration, so filter it * out to match. */ integrations: defaults => [ ...defaults.filter(i => i.name !== 'BrowserSession'), featureFlagsIntegration, ],})