Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function App() {
</header>

<section className="hero">
<img src="/logo.svg" alt="Lighthouse logo" width={120} height={120} />
<img src="/logo.svg" alt="Lighthouse logo" width={120} height={120} elementtiming="logo-svg" />
<h1>Lighthouse Fixture</h1>
<p>
This app exists to measure JavaScript bundle size and runtime cost across three Sentry instrumentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { createRoot } from 'react-dom/client';
import App from './App';

const sentryInitStart = performance.now();

performance.measure('sentry-sdk-pre-init-duration', {
detail: { mode: import.meta.env.MODE ?? 'unknown_mode' },
start: performance.timeOrigin,
end: sentryInitStart,
});
Comment thread
cursor[bot] marked this conversation as resolved.
Comment thread
sentry[bot] marked this conversation as resolved.

performance.mark('sentry-sdk-init-start', {
detail: { mode: import.meta.env.MODE ?? 'unknown_mode' },
});
Expand Down Expand Up @@ -33,6 +40,22 @@ if (import.meta.env.MODE === 'tracing-replay') {
release: 'lighthouse-fixture',
environment: 'qa',
});
} else if (import.meta.env.MODE === 'minimal-integrations') {
// Minimal integratoins setup only (everything necessary to automatically get errors)
Sentry.init({
dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined,
release: 'lighthouse-fixture',
environment: 'qa',
defaultIntegrations: false,
integrations: [
Sentry.globalHandlersIntegration(),
Sentry.linkedErrorsIntegration(),
Sentry.dedupeIntegration(),
// for good measure, let's include event filters since noise reduction is usually desired
// 99% of this integration's work is done in an event processor, so outside the hot path
Sentry.eventFiltersIntegration(),
],
});
} else if (import.meta.env.MODE === 'no-integrations') {
// DSN set but every integration disabled. Isolates the cost of the enabled
// client itself from the default instrumentation that wraps DOM/timer/network APIs.
Expand All @@ -54,6 +77,15 @@ if (import.meta.env.MODE === 'tracing-replay') {
integrations: defaultIntegrations =>
defaultIntegrations.filter(integration => integration.name !== 'BrowserApiErrors'),
});
} else if (import.meta.env.MODE === 'no-browser-breadcrumbs') {
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
// Default integrations minus Breadcrumbs, which adds a lot of monkey patching to
// DOM and Network APIs as well as event targets and listeners
Sentry.init({
dsn: import.meta.env.VITE_E2E_TEST_DSN as string | undefined,
release: 'lighthouse-fixture',
environment: 'qa',
integrations: defaultIntegrations => defaultIntegrations.filter(integration => integration.name !== 'Breadcrumbs'),
});
} else if (import.meta.env.MODE === 'init-only') {
// enabled: false makes the SDK a guaranteed no-op (no transport allocation,
// no DSN warning). We're measuring pure SDK-loading + tree-shaking cost.
Expand Down
Loading