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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingCoreIntegration(), Sentry.fetchTracingIntegration()],
tracePropagationTargets: ['http://sentry-test-site.example'],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fetch('http://sentry-test-site.example/0');
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { expect } from '@playwright/test';
import { sentryTest } from '../../../utils/fixtures';
import { shouldSkipTracingTest } from '../../../utils/helpers';
import { collectStreamedSpans, getSpanOp, waitForStreamedSpan } from '../../../utils/spanUtils';

sentryTest(
'composes browserTracingCoreIntegration() with only the standalone integrations passed to it',
async ({ getLocalTestUrl, page }) => {
sentryTest.skip(shouldSkipTracingTest());

await page.route('http://sentry-test-site.example/*', route => route.fulfill({ body: 'ok' }));

const url = await getLocalTestUrl({ testDir: __dirname });

const spans = collectStreamedSpans(page);
const pageloadPromise = waitForStreamedSpan(page, span => span.is_segment && getSpanOp(span) === 'pageload');

await page.goto(url);

const pageloadSpan = await pageloadPromise;
await page.evaluate(() => (window as any).Sentry.flush());

const requestSpans = spans.filter(span => getSpanOp(span) === 'http.client');
expect(requestSpans).toHaveLength(1);
expect(requestSpans[0]).toMatchObject({
parent_span_id: pageloadSpan.span_id,
trace_id: pageloadSpan.trace_id,
});

// `resourcesIntegration` was not added, so the page's own script loads must not produce spans.
expect(spans.filter(span => getSpanOp(span)?.startsWith('resource.'))).toHaveLength(0);
Comment thread
logaretm marked this conversation as resolved.
Resolved
},
);
12 changes: 12 additions & 0 deletions packages/browser/src/index.bundle.feedback.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
browserTracingIntegrationShim,
browserTracingCoreIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
fetchTracingIntegrationShim,
xhrTracingIntegrationShim,
linkedTracesIntegrationShim,
consoleLoggingIntegrationShim,
elementTimingIntegrationShim,
loggerShim,
Expand All @@ -18,6 +24,12 @@ export { getFeedback, sendFeedback } from '@sentry/feedback';

export {
browserTracingIntegrationShim as browserTracingIntegration,
browserTracingCoreIntegrationShim as browserTracingCoreIntegration,
longTasksIntegrationShim as longTasksIntegration,
resourcesIntegrationShim as resourcesIntegration,
fetchTracingIntegrationShim as fetchTracingIntegration,
xhrTracingIntegrationShim as xhrTracingIntegration,
linkedTracesIntegrationShim as linkedTracesIntegration,
elementTimingIntegrationShim as elementTimingIntegration,
feedbackAsyncIntegration as feedbackAsyncIntegration,
feedbackAsyncIntegration as feedbackIntegration,
Expand Down
12 changes: 12 additions & 0 deletions packages/browser/src/index.bundle.logs.metrics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
browserTracingIntegrationShim,
browserTracingCoreIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
fetchTracingIntegrationShim,
xhrTracingIntegrationShim,
linkedTracesIntegrationShim,
feedbackIntegrationShim,
replayIntegrationShim,
spanStreamingIntegrationShim,
Expand All @@ -14,6 +20,12 @@ export { elementTimingIntegration } from '@sentry/browser-utils';

export {
browserTracingIntegrationShim as browserTracingIntegration,
browserTracingCoreIntegrationShim as browserTracingCoreIntegration,
longTasksIntegrationShim as longTasksIntegration,
resourcesIntegrationShim as resourcesIntegration,
fetchTracingIntegrationShim as fetchTracingIntegration,
xhrTracingIntegrationShim as xhrTracingIntegration,
linkedTracesIntegrationShim as linkedTracesIntegration,
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
replayIntegrationShim as replayIntegration,
Expand Down
12 changes: 12 additions & 0 deletions packages/browser/src/index.bundle.replay.feedback.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
browserTracingIntegrationShim,
browserTracingCoreIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
fetchTracingIntegrationShim,
xhrTracingIntegrationShim,
linkedTracesIntegrationShim,
consoleLoggingIntegrationShim,
elementTimingIntegrationShim,
loggerShim,
Expand All @@ -17,6 +23,12 @@ export { getFeedback, sendFeedback } from '@sentry/feedback';

export {
browserTracingIntegrationShim as browserTracingIntegration,
browserTracingCoreIntegrationShim as browserTracingCoreIntegration,
longTasksIntegrationShim as longTasksIntegration,
resourcesIntegrationShim as resourcesIntegration,
fetchTracingIntegrationShim as fetchTracingIntegration,
xhrTracingIntegrationShim as xhrTracingIntegration,
linkedTracesIntegrationShim as linkedTracesIntegration,
elementTimingIntegrationShim as elementTimingIntegration,
feedbackAsyncIntegration as feedbackAsyncIntegration,
feedbackAsyncIntegration as feedbackIntegration,
Expand Down
12 changes: 12 additions & 0 deletions packages/browser/src/index.bundle.replay.logs.metrics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
browserTracingIntegrationShim,
browserTracingCoreIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
fetchTracingIntegrationShim,
xhrTracingIntegrationShim,
linkedTracesIntegrationShim,
feedbackIntegrationShim,
spanStreamingIntegrationShim,
fetchStreamPerformanceIntegrationShim,
Expand All @@ -15,6 +21,12 @@ export { elementTimingIntegration } from '@sentry/browser-utils';

export {
browserTracingIntegrationShim as browserTracingIntegration,
browserTracingCoreIntegrationShim as browserTracingCoreIntegration,
longTasksIntegrationShim as longTasksIntegration,
resourcesIntegrationShim as resourcesIntegration,
fetchTracingIntegrationShim as fetchTracingIntegration,
xhrTracingIntegrationShim as xhrTracingIntegration,
linkedTracesIntegrationShim as linkedTracesIntegration,
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
spanStreamingIntegrationShim as spanStreamingIntegration,
Expand Down
12 changes: 12 additions & 0 deletions packages/browser/src/index.bundle.replay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
browserTracingIntegrationShim,
browserTracingCoreIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
fetchTracingIntegrationShim,
xhrTracingIntegrationShim,
linkedTracesIntegrationShim,
consoleLoggingIntegrationShim,
elementTimingIntegrationShim,
feedbackIntegrationShim,
Expand All @@ -17,6 +23,12 @@ export { replayIntegration, getReplay } from '@sentry/replay';

export {
browserTracingIntegrationShim as browserTracingIntegration,
browserTracingCoreIntegrationShim as browserTracingCoreIntegration,
longTasksIntegrationShim as longTasksIntegration,
resourcesIntegrationShim as resourcesIntegration,
fetchTracingIntegrationShim as fetchTracingIntegration,
xhrTracingIntegrationShim as xhrTracingIntegration,
linkedTracesIntegrationShim as linkedTracesIntegration,
elementTimingIntegrationShim as elementTimingIntegration,
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
Expand Down
6 changes: 6 additions & 0 deletions packages/browser/src/index.bundle.tracing.logs.metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export {

export { startSpan, startInactiveSpan, startSpanManual } from '@sentry/core/browser';
export {
browserTracingCoreIntegration,
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
Expand All @@ -30,6 +31,11 @@ export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
export { webVitalsIntegration } from './integrations/webVitals';
export { longTasksIntegration } from './integrations/longTasks';
export { resourcesIntegration } from './integrations/resources';
export { fetchTracingIntegration } from './integrations/fetchTracing';
export { xhrTracingIntegration } from './integrations/xhrTracing';
export { linkedTracesIntegration } from './integrations/linkedTraces';

export {
feedbackIntegrationShim as feedbackAsyncIntegration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export {
export { startSpan, startInactiveSpan, startSpanManual } from '@sentry/core/browser';

export {
browserTracingCoreIntegration,
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
Expand All @@ -31,6 +32,11 @@ export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
export { webVitalsIntegration } from './integrations/webVitals';
export { longTasksIntegration } from './integrations/longTasks';
export { resourcesIntegration } from './integrations/resources';
export { fetchTracingIntegration } from './integrations/fetchTracing';
export { xhrTracingIntegration } from './integrations/xhrTracing';
export { linkedTracesIntegration } from './integrations/linkedTraces';

export { getFeedback, sendFeedback } from '@sentry/feedback';

Expand Down
6 changes: 6 additions & 0 deletions packages/browser/src/index.bundle.tracing.replay.feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export {
export { startSpan, startInactiveSpan, startSpanManual } from '@sentry/core/browser';

export {
browserTracingCoreIntegration,
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
Expand All @@ -37,6 +38,11 @@ export { reportPageLoaded } from './tracing/reportPageLoaded';

export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
export { webVitalsIntegration } from './integrations/webVitals';
export { longTasksIntegration } from './integrations/longTasks';
export { resourcesIntegration } from './integrations/resources';
export { fetchTracingIntegration } from './integrations/fetchTracing';
export { xhrTracingIntegration } from './integrations/xhrTracing';
export { linkedTracesIntegration } from './integrations/linkedTraces';

export { getFeedback, sendFeedback } from '@sentry/feedback';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export {
export { startSpan, startInactiveSpan, startSpanManual } from '@sentry/core/browser';

export {
browserTracingCoreIntegration,
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
Expand All @@ -30,6 +31,11 @@ export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
export { webVitalsIntegration } from './integrations/webVitals';
export { longTasksIntegration } from './integrations/longTasks';
export { resourcesIntegration } from './integrations/resources';
export { fetchTracingIntegration } from './integrations/fetchTracing';
export { xhrTracingIntegration } from './integrations/xhrTracing';
export { linkedTracesIntegration } from './integrations/linkedTraces';

export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration };

Expand Down
6 changes: 6 additions & 0 deletions packages/browser/src/index.bundle.tracing.replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export {
export { startSpan, startInactiveSpan, startSpanManual } from '@sentry/core/browser';

export {
browserTracingCoreIntegration,
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
Expand All @@ -36,6 +37,11 @@ export { setActiveSpanInBrowser } from './tracing/setActiveSpan';

export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
export { webVitalsIntegration } from './integrations/webVitals';
export { longTasksIntegration } from './integrations/longTasks';
export { resourcesIntegration } from './integrations/resources';
export { fetchTracingIntegration } from './integrations/fetchTracing';
export { xhrTracingIntegration } from './integrations/xhrTracing';
export { linkedTracesIntegration } from './integrations/linkedTraces';

export { feedbackIntegrationShim as feedbackAsyncIntegration, feedbackIntegrationShim as feedbackIntegration };

Expand Down
6 changes: 6 additions & 0 deletions packages/browser/src/index.bundle.tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
export { startSpan, startInactiveSpan, startSpanManual } from '@sentry/core/browser';

export {
browserTracingCoreIntegration,
browserTracingIntegration,
startBrowserTracingNavigationSpan,
startBrowserTracingPageLoadSpan,
Expand All @@ -38,6 +39,11 @@ export { reportPageLoaded } from './tracing/reportPageLoaded';

export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
export { webVitalsIntegration } from './integrations/webVitals';
export { longTasksIntegration } from './integrations/longTasks';
export { resourcesIntegration } from './integrations/resources';
export { fetchTracingIntegration } from './integrations/fetchTracing';
export { xhrTracingIntegration } from './integrations/xhrTracing';
export { linkedTracesIntegration } from './integrations/linkedTraces';

export {
feedbackIntegrationShim as feedbackAsyncIntegration,
Expand Down
12 changes: 12 additions & 0 deletions packages/browser/src/index.bundle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import {
browserTracingIntegrationShim,
browserTracingCoreIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
fetchTracingIntegrationShim,
xhrTracingIntegrationShim,
linkedTracesIntegrationShim,
consoleLoggingIntegrationShim,
elementTimingIntegrationShim,
feedbackIntegrationShim,
Expand All @@ -16,6 +22,12 @@ export { consoleLoggingIntegrationShim as consoleLoggingIntegration, loggerShim

export {
browserTracingIntegrationShim as browserTracingIntegration,
browserTracingCoreIntegrationShim as browserTracingCoreIntegration,
longTasksIntegrationShim as longTasksIntegration,
resourcesIntegrationShim as resourcesIntegration,
fetchTracingIntegrationShim as fetchTracingIntegration,
xhrTracingIntegrationShim as xhrTracingIntegration,
linkedTracesIntegrationShim as linkedTracesIntegration,
elementTimingIntegrationShim as elementTimingIntegration,
feedbackIntegrationShim as feedbackAsyncIntegration,
feedbackIntegrationShim as feedbackIntegration,
Expand Down
13 changes: 13 additions & 0 deletions packages/browser/test/index.bundle.feedback.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import {
browserTracingCoreIntegrationShim,
browserTracingIntegrationShim,
consoleLoggingIntegrationShim,
fetchTracingIntegrationShim,
linkedTracesIntegrationShim,
loggerShim,
longTasksIntegrationShim,
metricsShim,
replayIntegrationShim,
resourcesIntegrationShim,
spanStreamingIntegrationShim,
xhrTracingIntegrationShim,
} from '@sentry-internal/integration-shims';
import { describe, expect, it } from 'vitest';
import { feedbackAsyncIntegration } from '../src';
import * as FeedbackBundle from '../src/index.bundle.feedback';

describe('index.bundle.feedback', () => {
it('has correct exports', () => {
expect(FeedbackBundle.browserTracingCoreIntegration).toBe(browserTracingCoreIntegrationShim);
expect(FeedbackBundle.longTasksIntegration).toBe(longTasksIntegrationShim);
expect(FeedbackBundle.resourcesIntegration).toBe(resourcesIntegrationShim);
expect(FeedbackBundle.fetchTracingIntegration).toBe(fetchTracingIntegrationShim);
expect(FeedbackBundle.xhrTracingIntegration).toBe(xhrTracingIntegrationShim);
expect(FeedbackBundle.linkedTracesIntegration).toBe(linkedTracesIntegrationShim);

expect(FeedbackBundle.browserTracingIntegration).toBe(browserTracingIntegrationShim);
expect(FeedbackBundle.feedbackAsyncIntegration).toBe(feedbackAsyncIntegration);
expect(FeedbackBundle.feedbackIntegration).toBe(feedbackAsyncIntegration);
Expand Down
17 changes: 16 additions & 1 deletion packages/browser/test/index.bundle.logs.metrics.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import { logger as coreLogger, metrics as coreMetrics } from '@sentry/core';
import { spanStreamingIntegrationShim } from '@sentry-internal/integration-shims';
import {
browserTracingCoreIntegrationShim,
fetchTracingIntegrationShim,
linkedTracesIntegrationShim,
longTasksIntegrationShim,
resourcesIntegrationShim,
spanStreamingIntegrationShim,
xhrTracingIntegrationShim,
} from '@sentry-internal/integration-shims';
import { describe, expect, it } from 'vitest';
import * as LogsMetricsBundle from '../src/index.bundle.logs.metrics';

describe('index.bundle.logs.metrics', () => {
it('has correct exports', () => {
expect(LogsMetricsBundle.browserTracingCoreIntegration).toBe(browserTracingCoreIntegrationShim);
expect(LogsMetricsBundle.longTasksIntegration).toBe(longTasksIntegrationShim);
expect(LogsMetricsBundle.resourcesIntegration).toBe(resourcesIntegrationShim);
expect(LogsMetricsBundle.fetchTracingIntegration).toBe(fetchTracingIntegrationShim);
expect(LogsMetricsBundle.xhrTracingIntegration).toBe(xhrTracingIntegrationShim);
expect(LogsMetricsBundle.linkedTracesIntegration).toBe(linkedTracesIntegrationShim);

expect(LogsMetricsBundle.logger).toBe(coreLogger);
expect(LogsMetricsBundle.metrics).toBe(coreMetrics);
expect(LogsMetricsBundle.spanStreamingIntegration).toBe(spanStreamingIntegrationShim);
Expand Down
Loading
Loading