MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / initSentry

Function initSentry

src/utils/sentry.ts:308–341  ·  view source on GitHub ↗
(context?: Pick<SentryRuntimeContext, 'mode'>)

Source from the content-addressed store, hash-verified

306}
307
308export function initSentry(context?: Pick<SentryRuntimeContext, 'mode'>): void {
309 if (initialized || isSentryDisabled() || isTestEnv()) {
310 return;
311 }
312
313 initialized = true;
314
315 Sentry.init({
316 dsn:
317 process.env.SENTRY_DSN ??
318 'https://326e2c19ee84f3b2c892207b5726cde0@o1.ingest.us.sentry.io/4510869777416192',
319
320 // Keep Sentry defaults as lean as possible for privacy: internal failures only.
321 sendDefaultPii: false,
322 tracesSampleRate: 1.0,
323 enableLogs: true,
324 _experiments: {
325 enableMetrics: true,
326 },
327 maxBreadcrumbs: 0,
328 beforeBreadcrumb: () => null,
329 beforeSend: redactEvent,
330 beforeSendLog: redactLog,
331 serverName: '',
332 release: `xcodebuildmcp@${version}`,
333 environment: 'production',
334 });
335
336 if (context?.mode) {
337 Sentry.setTag('runtime.mode', context.mode);
338 }
339
340 emitSentrySelfTest(context?.mode);
341}
342
343export function enrichSentryContext(): void {
344 if (!initialized || enriched || isSentryDisabled() || isTestEnv() || isSentryCaptureSealed()) {

Callers 3

mainFunction · 0.90
mainFunction · 0.90
startMcpServerFunction · 0.90

Calls 3

isSentryDisabledFunction · 0.85
emitSentrySelfTestFunction · 0.85
isTestEnvFunction · 0.70

Tested by

no test coverage detected