Skip to content

Commit d836ff0

Browse files
committed
add cdn bundle for tracing.logs.metrics
1 parent 3ff89c6 commit d836ff0

4 files changed

Lines changed: 75 additions & 0 deletions

File tree

.size-limit.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ module.exports = [
186186
gzip: true,
187187
limit: '42.5 KB',
188188
},
189+
{
190+
name: 'CDN Bundle (incl. Tracing, Logs, Metrics)',
191+
path: createCDNPath('bundle.tracing.logs.metrics.min.js'),
192+
gzip: true,
193+
limit: '45 KB',
194+
},
189195
{
190196
name: 'CDN Bundle (incl. Tracing, Replay)',
191197
path: createCDNPath('bundle.tracing.replay.min.js'),
@@ -213,6 +219,13 @@ module.exports = [
213219
brotli: false,
214220
limit: '127 KB',
215221
},
222+
{
223+
name: 'CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed',
224+
path: createCDNPath('bundle.tracing.logs.metrics.min.js'),
225+
gzip: false,
226+
brotli: false,
227+
limit: '140 KB',
228+
},
216229
{
217230
name: 'CDN Bundle (incl. Tracing, Replay) - uncompressed',
218231
path: createCDNPath('bundle.tracing.replay.min.js'),

packages/browser/rollup.bundle.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ const tracingReplayFeedbackBaseBundleConfig = makeBaseBundleConfig({
104104
outputFileBase: () => 'bundles/bundle.tracing.replay.feedback',
105105
});
106106

107+
const tracingLogsMetricsBaseBundleConfig = makeBaseBundleConfig({
108+
bundleType: 'standalone',
109+
entrypoints: ['src/index.bundle.tracing.logs.metrics.ts'],
110+
licenseTitle: '@sentry/browser (Performance Monitoring, Logs, and Metrics)',
111+
outputFileBase: () => 'bundles/bundle.tracing.logs.metrics',
112+
});
113+
107114
builds.push(
108115
...makeBundleConfigVariants(baseBundleConfig),
109116
...makeBundleConfigVariants(tracingBaseBundleConfig),
@@ -112,6 +119,7 @@ builds.push(
112119
...makeBundleConfigVariants(tracingReplayBaseBundleConfig),
113120
...makeBundleConfigVariants(replayFeedbackBaseBundleConfig),
114121
...makeBundleConfigVariants(tracingReplayFeedbackBaseBundleConfig),
122+
...makeBundleConfigVariants(tracingLogsMetricsBaseBundleConfig),
115123
);
116124

117125
export default builds;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { registerSpanErrorInstrumentation } from '@sentry/core';
2+
import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
3+
4+
registerSpanErrorInstrumentation();
5+
6+
export * from './index.bundle.base';
7+
8+
// TODO(v11): Export metrics here once we remove it from the base bundle.
9+
export { logger } from '@sentry/core';
10+
11+
export {
12+
getActiveSpan,
13+
getRootSpan,
14+
getSpanDescendants,
15+
setMeasurement,
16+
startInactiveSpan,
17+
startNewTrace,
18+
startSpan,
19+
startSpanManual,
20+
withActiveSpan,
21+
} from '@sentry/core';
22+
23+
export {
24+
browserTracingIntegration,
25+
startBrowserTracingNavigationSpan,
26+
startBrowserTracingPageLoadSpan,
27+
} from './tracing/browserTracingIntegration';
28+
export { reportPageLoaded } from './tracing/reportPageLoaded';
29+
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';
30+
31+
export {
32+
feedbackIntegrationShim as feedbackAsyncIntegration,
33+
feedbackIntegrationShim as feedbackIntegration,
34+
replayIntegrationShim as replayIntegration,
35+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { logger as coreLogger, metrics as coreMetrics } from '@sentry/core';
2+
import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims';
3+
import { describe, expect, it } from 'vitest';
4+
import { browserTracingIntegration } from '../src';
5+
import * as TracingLogsMetricsBundle from '../src/index.bundle.tracing.logs.metrics';
6+
7+
describe('index.bundle.tracing.logs.metrics', () => {
8+
it('has correct exports', () => {
9+
expect(TracingLogsMetricsBundle.browserTracingIntegration).toBe(browserTracingIntegration);
10+
expect(TracingLogsMetricsBundle.feedbackAsyncIntegration).toBe(feedbackIntegrationShim);
11+
expect(TracingLogsMetricsBundle.feedbackIntegration).toBe(feedbackIntegrationShim);
12+
expect(TracingLogsMetricsBundle.replayIntegration).toBe(replayIntegrationShim);
13+
14+
expect(TracingLogsMetricsBundle.logger).toBe(coreLogger);
15+
expect(TracingLogsMetricsBundle.metrics).toBe(coreMetrics);
16+
});
17+
});
18+
19+

0 commit comments

Comments
 (0)