Skip to content

Commit 56486f1

Browse files
authored
Merge branch 'develop' into cg-rr-server-loaders
2 parents f579921 + f4ee9bf commit 56486f1

File tree

99 files changed

+8396
-869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+8396
-869
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = [
5454
path: 'packages/browser/build/npm/esm/index.js',
5555
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
5656
gzip: true,
57-
limit: '70 KB',
57+
limit: '70.1 KB',
5858
modifyWebpackConfig: function (config) {
5959
const webpack = require('webpack');
6060
const TerserPlugin = require('terser-webpack-plugin');

dev-packages/e2e-tests/test-applications/nextjs-turbo/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@
3535
"@sentry/opentelemetry": "latest || *",
3636
"@sentry/react": "latest || *",
3737
"@sentry-internal/replay": "latest || *",
38-
"@sentry/vercel-edge": "latest || *",
39-
"import-in-the-middle": "1.12.0"
40-
},
41-
"overrides": {
42-
"import-in-the-middle": "1.12.0"
38+
"@sentry/vercel-edge": "latest || *"
4339
},
4440
"volta": {
4541
"extends": "../../package.json"

dev-packages/node-integration-tests/.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = {
1818
sourceType: 'module',
1919
ecmaVersion: 'latest',
2020
},
21+
globals: {
22+
fetch: 'readonly',
23+
},
2124
rules: {
2225
'@typescript-eslint/typedef': 'off',
2326
// Explicitly allow ts-ignore with description for Node integration tests
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://[email protected]/1337',
6+
release: '1.0',
7+
tracePropagationTargets: [/\/v0/, 'v1'],
8+
integrations: [],
9+
transport: loggingTransport,
10+
tracesSampleRate: 0.0,
11+
// Ensure this gets a correct hint
12+
beforeBreadcrumb(breadcrumb, hint) {
13+
breadcrumb.data = breadcrumb.data || {};
14+
const req = hint?.request;
15+
breadcrumb.data.ADDED_PATH = req?.path;
16+
return breadcrumb;
17+
},
18+
});

dev-packages/node-integration-tests/suites/tracing/requests/fetch-sampled-no-active-span/scenario.ts renamed to dev-packages/node-integration-tests/suites/tracing/requests/fetch-breadcrumbs/scenario.mjs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
import * as Sentry from '@sentry/node';
2-
import { loggingTransport } from '@sentry-internal/node-integration-tests';
32

4-
Sentry.init({
5-
dsn: 'https://[email protected]/1337',
6-
release: '1.0',
7-
tracePropagationTargets: [/\/v0/, 'v1'],
8-
tracesSampleRate: 1.0,
9-
integrations: [],
10-
transport: loggingTransport,
11-
});
3+
async function run() {
4+
Sentry.addBreadcrumb({ message: 'manual breadcrumb' });
125

13-
async function run(): Promise<void> {
146
await fetch(`${process.env.SERVER_URL}/api/v0`).then(res => res.text());
157
await fetch(`${process.env.SERVER_URL}/api/v1`).then(res => res.text());
168
await fetch(`${process.env.SERVER_URL}/api/v2`).then(res => res.text());
@@ -19,5 +11,4 @@ async function run(): Promise<void> {
1911
Sentry.captureException(new Error('foo'));
2012
}
2113

22-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
2314
run();

dev-packages/node-integration-tests/suites/tracing/requests/fetch-breadcrumbs/scenario.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,80 @@
1-
import { describe, expect, test } from 'vitest';
2-
import { createRunner } from '../../../../utils/runner';
1+
import { describe, expect } from 'vitest';
2+
import { createEsmAndCjsTests } from '../../../../utils/runner';
33
import { createTestServer } from '../../../../utils/server';
44

55
describe('outgoing fetch', () => {
6-
test('outgoing fetch requests create breadcrumbs', async () => {
7-
const [SERVER_URL, closeTestServer] = await createTestServer().start();
6+
createEsmAndCjsTests(__dirname, 'scenario.mjs', 'instrument.mjs', (createRunner, test) => {
7+
test('outgoing fetch requests create breadcrumbs xxx', async () => {
8+
const [SERVER_URL, closeTestServer] = await createTestServer().start();
89

9-
await createRunner(__dirname, 'scenario.ts')
10-
.withEnv({ SERVER_URL })
11-
.ensureNoErrorOutput()
12-
.expect({
13-
event: {
14-
breadcrumbs: [
15-
{
16-
message: 'manual breadcrumb',
17-
timestamp: expect.any(Number),
18-
},
19-
{
20-
category: 'http',
21-
data: {
22-
'http.method': 'GET',
23-
url: `${SERVER_URL}/api/v0`,
24-
status_code: 404,
25-
ADDED_PATH: '/api/v0',
10+
await createRunner()
11+
.withEnv({ SERVER_URL })
12+
.expect({
13+
event: {
14+
breadcrumbs: [
15+
{
16+
message: 'manual breadcrumb',
17+
timestamp: expect.any(Number),
2618
},
27-
timestamp: expect.any(Number),
28-
type: 'http',
29-
},
30-
{
31-
category: 'http',
32-
data: {
33-
'http.method': 'GET',
34-
url: `${SERVER_URL}/api/v1`,
35-
status_code: 404,
36-
ADDED_PATH: '/api/v1',
19+
{
20+
category: 'http',
21+
data: {
22+
'http.method': 'GET',
23+
url: `${SERVER_URL}/api/v0`,
24+
status_code: 404,
25+
ADDED_PATH: '/api/v0',
26+
},
27+
timestamp: expect.any(Number),
28+
type: 'http',
3729
},
38-
timestamp: expect.any(Number),
39-
type: 'http',
40-
},
41-
{
42-
category: 'http',
43-
data: {
44-
'http.method': 'GET',
45-
url: `${SERVER_URL}/api/v2`,
46-
status_code: 404,
47-
ADDED_PATH: '/api/v2',
30+
{
31+
category: 'http',
32+
data: {
33+
'http.method': 'GET',
34+
url: `${SERVER_URL}/api/v1`,
35+
status_code: 404,
36+
ADDED_PATH: '/api/v1',
37+
},
38+
timestamp: expect.any(Number),
39+
type: 'http',
4840
},
49-
timestamp: expect.any(Number),
50-
type: 'http',
51-
},
52-
{
53-
category: 'http',
54-
data: {
55-
'http.method': 'GET',
56-
url: `${SERVER_URL}/api/v3`,
57-
status_code: 404,
58-
ADDED_PATH: '/api/v3',
41+
{
42+
category: 'http',
43+
data: {
44+
'http.method': 'GET',
45+
url: `${SERVER_URL}/api/v2`,
46+
status_code: 404,
47+
ADDED_PATH: '/api/v2',
48+
},
49+
timestamp: expect.any(Number),
50+
type: 'http',
5951
},
60-
timestamp: expect.any(Number),
61-
type: 'http',
62-
},
63-
],
64-
exception: {
65-
values: [
6652
{
67-
type: 'Error',
68-
value: 'foo',
53+
category: 'http',
54+
data: {
55+
'http.method': 'GET',
56+
url: `${SERVER_URL}/api/v3`,
57+
status_code: 404,
58+
ADDED_PATH: '/api/v3',
59+
},
60+
timestamp: expect.any(Number),
61+
type: 'http',
6962
},
7063
],
64+
exception: {
65+
values: [
66+
{
67+
type: 'Error',
68+
value: 'foo',
69+
},
70+
],
71+
},
7172
},
72-
},
73-
})
74-
.start()
75-
.completed();
76-
closeTestServer();
73+
})
74+
.start()
75+
.completed();
76+
77+
closeTestServer();
78+
});
7779
});
7880
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Sentry from '@sentry/node';
2+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
3+
4+
Sentry.init({
5+
dsn: 'https://[email protected]/1337',
6+
release: '1.0',
7+
tracePropagationTargets: [/\/v0/, 'v1'],
8+
integrations: [Sentry.nativeNodeFetchIntegration({ spans: false })],
9+
transport: loggingTransport,
10+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import * as Sentry from '@sentry/node';
2+
3+
async function run() {
4+
await fetch(`${process.env.SERVER_URL}/api/v0`).then(res => res.text());
5+
await fetch(`${process.env.SERVER_URL}/api/v1`).then(res => res.text());
6+
await fetch(`${process.env.SERVER_URL}/api/v2`).then(res => res.text());
7+
await fetch(`${process.env.SERVER_URL}/api/v3`).then(res => res.text());
8+
9+
Sentry.captureException(new Error('foo'));
10+
}
11+
12+
run();

dev-packages/node-integration-tests/suites/tracing/requests/fetch-no-tracing-no-spans/scenario.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)