Skip to content

Commit 611df2c

Browse files
authored
Merge branch 'develop' into aliu/launch-darkly-integration
2 parents a2ba257 + 5b77377 commit 611df2c

File tree

39 files changed

+664
-28
lines changed

39 files changed

+664
-28
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ jobs:
938938
'node-koa',
939939
'node-connect',
940940
'nuxt-3',
941+
'nuxt-3-min',
941942
'nuxt-4',
942943
'vue-3',
943944
'webpack-4',

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ module.exports = [
139139
path: 'packages/vue/build/esm/index.js',
140140
import: createImport('init', 'browserTracingIntegration'),
141141
gzip: true,
142-
limit: '38.2 KB',
142+
limit: '38.5 KB',
143143
},
144144
// Svelte SDK (ESM)
145145
{

dev-packages/browser-integration-tests/suites/public-api/startSpan/basic/test.ts

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
11
import { expect } from '@playwright/test';
22

3+
import {
4+
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
5+
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
6+
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
7+
} from '@sentry/browser';
38
import { sentryTest } from '../../../../utils/fixtures';
49
import {
510
envelopeRequestParser,
611
shouldSkipTracingTest,
712
waitForTransactionRequestOnUrl,
813
} from '../../../../utils/helpers';
914

10-
sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath, page }) => {
11-
if (shouldSkipTracingTest()) {
12-
sentryTest.skip();
13-
}
14-
15-
const url = await getLocalTestPath({ testDir: __dirname });
16-
const req = await waitForTransactionRequestOnUrl(page, url);
17-
const transaction = envelopeRequestParser(req);
18-
19-
expect(transaction.transaction).toBe('parent_span');
20-
expect(transaction.spans).toBeDefined();
21-
});
15+
sentryTest(
16+
'sends a transaction in an envelope with manual origin and custom source',
17+
async ({ getLocalTestPath, page }) => {
18+
if (shouldSkipTracingTest()) {
19+
sentryTest.skip();
20+
}
21+
22+
const url = await getLocalTestPath({ testDir: __dirname });
23+
const req = await waitForTransactionRequestOnUrl(page, url);
24+
const transaction = envelopeRequestParser(req);
25+
26+
const attributes = transaction.contexts?.trace?.data;
27+
expect(attributes).toEqual({
28+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual',
29+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
30+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',
31+
});
32+
33+
expect(transaction.transaction_info?.source).toBe('custom');
34+
35+
expect(transaction.transaction).toBe('parent_span');
36+
expect(transaction.spans).toBeDefined();
37+
},
38+
);
2239

2340
sentryTest('should report finished spans as children of the root transaction', async ({ getLocalTestPath, page }) => {
2441
if (shouldSkipTracingTest()) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
window._testBaseTimestamp = performance.timeOrigin / 1000;
5+
6+
Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
integrations: [Sentry.browserTracingIntegration()],
9+
tracesSampleRate: 1,
10+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const activeSpan = Sentry.getActiveSpan();
2+
const rootSpan = activeSpan && Sentry.getRootSpan(activeSpan);
3+
rootSpan?.updateName('new name');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/types';
3+
4+
import {
5+
SEMANTIC_ATTRIBUTE_SENTRY_OP,
6+
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
7+
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
8+
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
9+
} from '@sentry/browser';
10+
import { sentryTest } from '../../../../utils/fixtures';
11+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
12+
13+
sentryTest('sets the source to custom when updating the transaction name', async ({ getLocalTestPath, page }) => {
14+
if (shouldSkipTracingTest()) {
15+
sentryTest.skip();
16+
}
17+
18+
const url = await getLocalTestPath({ testDir: __dirname });
19+
20+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
21+
22+
const traceContextData = eventData.contexts?.trace?.data;
23+
24+
expect(traceContextData).toMatchObject({
25+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
26+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
27+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom',
28+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
29+
});
30+
31+
expect(eventData.transaction).toBe('new name');
32+
33+
expect(eventData.contexts?.trace?.op).toBe('pageload');
34+
expect(eventData.spans?.length).toBeGreaterThan(0);
35+
expect(eventData.transaction_info?.source).toEqual('custom');
36+
});

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageload/test.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import { expect } from '@playwright/test';
22
import type { Event } from '@sentry/types';
33

4+
import {
5+
SEMANTIC_ATTRIBUTE_SENTRY_OP,
6+
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
7+
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
8+
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
9+
} from '@sentry/browser';
410
import { sentryTest } from '../../../../utils/fixtures';
511
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
612

7-
sentryTest('should create a pageload transaction', async ({ getLocalTestPath, page }) => {
13+
sentryTest('creates a pageload transaction with url as source', async ({ getLocalTestPath, page }) => {
814
if (shouldSkipTracingTest()) {
915
sentryTest.skip();
1016
}
@@ -16,8 +22,17 @@ sentryTest('should create a pageload transaction', async ({ getLocalTestPath, pa
1622

1723
const { start_timestamp: startTimestamp } = eventData;
1824

25+
const traceContextData = eventData.contexts?.trace?.data;
26+
1927
expect(startTimestamp).toBeCloseTo(timeOrigin, 1);
2028

29+
expect(traceContextData).toMatchObject({
30+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
31+
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1,
32+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
33+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
34+
});
35+
2136
expect(eventData.contexts?.trace?.op).toBe('pageload');
2237
expect(eventData.spans?.length).toBeGreaterThan(0);
2338
expect(eventData.transaction_info?.source).toEqual('url');
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<NuxtLayout>
3+
<header>
4+
<nav>
5+
<ul>
6+
<li><NuxtLink to="/fetch-server-error">Fetch Server Error</NuxtLink></li>
7+
<li><NuxtLink to="/test-param/1234">Fetch Param</NuxtLink></li>
8+
<li><NuxtLink to="/client-error">Client Error</NuxtLink></li>
9+
</ul>
10+
</nav>
11+
</header>
12+
<NuxtPage />
13+
</NuxtLayout>
14+
</template>
15+
16+
<script setup>
17+
</script>

0 commit comments

Comments
 (0)