Skip to content

Commit 27e4a18

Browse files
authored
Merge branch 'develop' into sig/astro-waitUntil
2 parents 2621c02 + 22c3865 commit 27e4a18

File tree

82 files changed

+726
-3746
lines changed

Some content is hidden

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

82 files changed

+726
-3746
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ updates:
1313
schedule:
1414
interval: 'weekly'
1515
allow:
16-
- dependency-name: "@sentry/cli"
17-
- dependency-name: "@sentry/vite-plugin"
18-
- dependency-name: "@sentry/webpack-plugin"
19-
- dependency-name: "@sentry/rollup-plugin"
20-
- dependency-name: "@sentry/esbuild-plugin"
16+
- dependency-name: "@sentry/*"
2117
- dependency-name: "@opentelemetry/*"
2218
- dependency-name: "@prisma/instrumentation"
19+
- dependency-name: "opentelemetry-instrumentation-remix"
2320
versioning-strategy: increase
2421
commit-message:
2522
prefix: feat

.github/workflows/build.yml

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ jobs:
437437
with:
438438
node-version-file: 'package.json'
439439
- name: Set up Deno
440-
uses: denoland/setup-deno@v1.5.1
440+
uses: denoland/setup-deno@v2.0.1
441441
with:
442442
deno-version: v1.38.5
443443
- name: Restore caches
@@ -858,7 +858,7 @@ jobs:
858858
if: always() && needs.job_e2e_prepare.result == 'success'
859859
needs: [job_get_metadata, job_build, job_e2e_prepare]
860860
runs-on: ubuntu-20.04
861-
timeout-minutes: 10
861+
timeout-minutes: 15
862862
env:
863863
# We just use a dummy DSN here, only send to the tunnel anyhow
864864
E2E_TEST_DSN: 'https://username@domain/123'
@@ -1070,7 +1070,7 @@ jobs:
10701070
github.actor != 'dependabot[bot]'
10711071
needs: [job_get_metadata, job_build, job_e2e_prepare]
10721072
runs-on: ubuntu-20.04
1073-
timeout-minutes: 10
1073+
timeout-minutes: 15
10741074
env:
10751075
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
10761076
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
@@ -1234,7 +1234,7 @@ jobs:
12341234
)
12351235
needs: [job_get_metadata, job_build, job_e2e_prepare]
12361236
runs-on: ubuntu-20.04
1237-
timeout-minutes: 10
1237+
timeout-minutes: 15
12381238
env:
12391239
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
12401240
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
@@ -1345,48 +1345,6 @@ jobs:
13451345
run: |
13461346
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
13471347
1348-
overhead_metrics:
1349-
name: Overhead metrics
1350-
needs: [job_get_metadata, job_build]
1351-
runs-on: ubuntu-20.04
1352-
timeout-minutes: 30
1353-
if: |
1354-
contains(github.event.pull_request.labels.*.name, 'ci-overhead-measurements')
1355-
steps:
1356-
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
1357-
uses: actions/checkout@v4
1358-
with:
1359-
ref: ${{ env.HEAD_COMMIT }}
1360-
- name: Set up Node
1361-
uses: actions/setup-node@v4
1362-
with:
1363-
node-version-file: 'package.json'
1364-
- name: Restore caches
1365-
uses: ./.github/actions/restore-cache
1366-
with:
1367-
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
1368-
1369-
- name: Collect
1370-
run: yarn ci:collect
1371-
working-directory: dev-packages/overhead-metrics
1372-
1373-
- name: Process
1374-
id: process
1375-
run: yarn ci:process
1376-
working-directory: dev-packages/overhead-metrics
1377-
# Don't run on forks - the PR comment cannot be added.
1378-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
1379-
env:
1380-
GITHUB_TOKEN: ${{ github.token }}
1381-
1382-
- name: Upload results
1383-
uses: actions/upload-artifact@v4
1384-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
1385-
with:
1386-
name: ${{ steps.process.outputs.artifactName }}
1387-
path: ${{ steps.process.outputs.artifactPath }}
1388-
retention-days: 7
1389-
13901348
job_compile_bindings_profiling_node:
13911349
name: Compile & Test Profiling Bindings (v${{ matrix.node }}) ${{ matrix.target_platform || matrix.os }}, ${{ matrix.node || matrix.container }}, ${{ matrix.arch || matrix.container }}, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }}
13921350
needs: [job_get_metadata, job_build]

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ name: 'CI: CodeQL'
1414
on:
1515
push:
1616
branches: [develop]
17+
branches-ignore:
18+
# Ignore dependabot branches
19+
- "dependabot/**"
1720
pull_request:
1821
# The branches below must be a subset of the branches above
1922
branches: [develop]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
window.fetchCallCount = 0;
6+
window.spanEnded = false;
7+
8+
const originalWindowFetch = window.fetch;
9+
window.fetch = (...args) => {
10+
window.fetchCallCount++;
11+
return originalWindowFetch(...args);
12+
};
13+
14+
Sentry.init({
15+
dsn: 'https://[email protected]/1337',
16+
tracesSampleRate: 1.0,
17+
enabled: false,
18+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Sentry.startSpan({ name: 'standalone_segment_span', experimental: { standalone: true } }, () => {});
2+
3+
window.spanEnded = true;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest("doesn't send a standalone span envelope if SDK is disabled", async ({ getLocalTestPath, page }) => {
7+
if (shouldSkipTracingTest()) {
8+
sentryTest.skip();
9+
}
10+
11+
const url = await getLocalTestPath({ testDir: __dirname });
12+
await page.goto(url);
13+
14+
// @ts-expect-error this exists in the test init/subject
15+
await page.waitForFunction(() => !!window.spanEnded);
16+
await page.waitForTimeout(2000);
17+
18+
// @ts-expect-error this exists in the test init
19+
const fetchCallCount = await page.evaluate(() => window.fetchCallCount);
20+
// We expect no fetch calls because the SDK is disabled
21+
expect(fetchCallCount).toBe(0);
22+
});

dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@sentry/node": "latest || *"
1414
},
1515
"devDependencies": {
16-
"rollup": "^4.0.2",
16+
"rollup": "^4.24.2",
1717
"vitest": "^0.34.6",
1818
"@sentry/rollup-plugin": "2.22.6"
1919
},

dev-packages/e2e-tests/test-applications/nextjs-13/sentry.client.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import * as Sentry from '@sentry/nextjs';
24

35
Sentry.init({

dev-packages/e2e-tests/test-applications/nextjs-14/sentry.client.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import * as Sentry from '@sentry/nextjs';
24

35
Sentry.init({

dev-packages/e2e-tests/test-applications/nextjs-15/sentry.client.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import * as Sentry from '@sentry/nextjs';
24

35
Sentry.init({

dev-packages/e2e-tests/test-applications/nextjs-app-dir/sentry.client.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import * as Sentry from '@sentry/nextjs';
24

35
Sentry.init({

dev-packages/e2e-tests/test-applications/nextjs-t3/sentry.client.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client';
2+
13
import * as Sentry from '@sentry/nextjs';
24

35
Sentry.init({
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import { HackComponentToRunSideEffectsInSentryClientConfig } from '../sentry.client.config';
2+
13
export default function Layout({ children }: { children: React.ReactNode }) {
24
return (
35
<html lang="en">
4-
<body>{children}</body>
6+
<body>
7+
<HackComponentToRunSideEffectsInSentryClientConfig />
8+
{children}
9+
</body>
510
</html>
611
);
712
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference types="next/navigation-types/compat/navigation" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default function Page() {
2+
<p>Hello World!</p>;
3+
}
4+
5+
// getServerSideProps makes this page dynamic and allows tracing data to be inserted
6+
export async function getServerSideProps() {
7+
return {
8+
props: {},
9+
};
10+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { AppProps } from 'next/app';
2+
import '../sentry.client.config';
3+
4+
export default function CustomApp({ Component, pageProps }: AppProps) {
5+
return <Component {...pageProps} />;
6+
}
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
'use client';
2+
13
import * as Sentry from '@sentry/nextjs';
24

3-
Sentry.init({
4-
environment: 'qa', // dynamic sampling bias to keep transactions
5-
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
6-
tunnel: `http://localhost:3031/`, // proxy server
7-
tracesSampleRate: 1.0,
8-
sendDefaultPii: true,
9-
});
5+
if (typeof window !== 'undefined') {
6+
Sentry.init({
7+
environment: 'qa', // dynamic sampling bias to keep transactions
8+
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
9+
tunnel: `http://localhost:3031/`, // proxy server
10+
tracesSampleRate: 1.0,
11+
sendDefaultPii: true,
12+
});
13+
}
14+
15+
export function HackComponentToRunSideEffectsInSentryClientConfig() {
16+
return null;
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { expect, test } from '@playwright/test';
2+
import { waitForTransaction } from '@sentry-internal/test-utils';
3+
4+
test('Should propagate traces from server to client in pages router', async ({ page }) => {
5+
const serverTransactionPromise = waitForTransaction('nextjs-turbo', async transactionEvent => {
6+
return transactionEvent?.transaction === 'GET /[param]/pages-router-client-trace-propagation';
7+
});
8+
9+
const pageloadTransactionPromise = waitForTransaction('nextjs-turbo', async transactionEvent => {
10+
return transactionEvent?.transaction === '/[param]/pages-router-client-trace-propagation';
11+
});
12+
13+
await page.goto(`/123/pages-router-client-trace-propagation`);
14+
15+
const serverTransaction = await serverTransactionPromise;
16+
const pageloadTransaction = await pageloadTransactionPromise;
17+
18+
expect(serverTransaction.contexts?.trace?.trace_id).toBeDefined();
19+
expect(pageloadTransaction.contexts?.trace?.trace_id).toBe(serverTransaction.contexts?.trace?.trace_id);
20+
});

dev-packages/e2e-tests/test-applications/tanstack-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@typescript-eslint/parser": "^7.2.0",
2525
"@vitejs/plugin-react-swc": "^3.5.0",
2626
"typescript": "^5.2.2",
27-
"vite": "^5.2.0",
27+
"vite": "^5.2.14",
2828
"@playwright/test": "^1.44.1",
2929
"@sentry-internal/test-utils": "link:../../../test-utils"
3030
},

0 commit comments

Comments
 (0)