-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12236 from getsentry/prepare-release/8.5.0
meta: Add CHANGELOG entry for `8.5.0`
- Loading branch information
Showing
147 changed files
with
3,027 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
12 changes: 10 additions & 2 deletions
12
...-integration-tests/suites/metrics/test.ts → ...tests/suites/metrics/metricsEvent/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
dev-packages/browser-integration-tests/suites/metrics/metricsShim/init.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
window.Sentry = Sentry; | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
}); | ||
|
||
// This should not fail | ||
Sentry.metrics.increment('increment'); | ||
Sentry.metrics.distribution('distribution', 42); | ||
Sentry.metrics.gauge('gauge', 5); | ||
Sentry.metrics.set('set', 'nope'); |
36 changes: 36 additions & 0 deletions
36
dev-packages/browser-integration-tests/suites/metrics/metricsShim/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { expect } from '@playwright/test'; | ||
|
||
import { sentryTest } from '../../../utils/fixtures'; | ||
import { shouldSkipMetricsTest } from '../../../utils/helpers'; | ||
|
||
sentryTest('exports shim metrics integration for non-tracing bundles', async ({ getLocalTestPath, page }) => { | ||
// Skip in tracing tests | ||
if (!shouldSkipMetricsTest()) { | ||
sentryTest.skip(); | ||
} | ||
|
||
const consoleMessages: string[] = []; | ||
page.on('console', msg => consoleMessages.push(msg.text())); | ||
|
||
let requestCount = 0; | ||
await page.route('https://dsn.ingest.sentry.io/**/*', route => { | ||
requestCount++; | ||
return route.fulfill({ | ||
status: 200, | ||
contentType: 'application/json', | ||
body: JSON.stringify({ id: 'test-id' }), | ||
}); | ||
}); | ||
|
||
const url = await getLocalTestPath({ testDir: __dirname }); | ||
|
||
await page.goto(url); | ||
|
||
expect(requestCount).toBe(0); | ||
expect(consoleMessages).toEqual([ | ||
'You are using metrics even though this bundle does not include tracing.', | ||
'You are using metrics even though this bundle does not include tracing.', | ||
'You are using metrics even though this bundle does not include tracing.', | ||
'You are using metrics even though this bundle does not include tracing.', | ||
]); | ||
}); |
15 changes: 15 additions & 0 deletions
15
...packages/browser-integration-tests/suites/tracing/trace-lifetime/startNewTrace/subject.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const newTraceBtn = document.getElementById('newTrace'); | ||
newTraceBtn.addEventListener('click', async () => { | ||
Sentry.startNewTrace(() => { | ||
Sentry.startSpan({ op: 'ui.interaction.click', name: 'new-trace' }, async () => { | ||
await fetch('http://example.com'); | ||
}); | ||
}); | ||
}); | ||
|
||
const oldTraceBtn = document.getElementById('oldTrace'); | ||
oldTraceBtn.addEventListener('click', async () => { | ||
Sentry.startSpan({ op: 'ui.interaction.click', name: 'old-trace' }, async () => { | ||
await fetch('http://example.com'); | ||
}); | ||
}); |
10 changes: 10 additions & 0 deletions
10
...kages/browser-integration-tests/suites/tracing/trace-lifetime/startNewTrace/template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<button id="oldTrace">Old Trace</button> | ||
<button id="newTrace">new Trace</button> | ||
</body> | ||
</html> |
106 changes: 106 additions & 0 deletions
106
dev-packages/browser-integration-tests/suites/tracing/trace-lifetime/startNewTrace/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import { expect } from '@playwright/test'; | ||
import { sentryTest } from '../../../../utils/fixtures'; | ||
import type { EventAndTraceHeader } from '../../../../utils/helpers'; | ||
import { | ||
eventAndTraceHeaderRequestParser, | ||
getFirstSentryEnvelopeRequest, | ||
getMultipleSentryEnvelopeRequests, | ||
shouldSkipTracingTest, | ||
} from '../../../../utils/helpers'; | ||
|
||
sentryTest( | ||
'creates a new trace if `startNewTrace` is called and leaves old trace valid outside the callback', | ||
async ({ getLocalTestUrl, page }) => { | ||
if (shouldSkipTracingTest()) { | ||
sentryTest.skip(); | ||
} | ||
|
||
const url = await getLocalTestUrl({ testDir: __dirname }); | ||
|
||
await page.route('http://example.com/**', route => { | ||
return route.fulfill({ | ||
status: 200, | ||
contentType: 'application/json', | ||
body: JSON.stringify({}), | ||
}); | ||
}); | ||
|
||
const [pageloadEvent, pageloadTraceHeaders] = await getFirstSentryEnvelopeRequest<EventAndTraceHeader>( | ||
page, | ||
url, | ||
eventAndTraceHeaderRequestParser, | ||
); | ||
|
||
const pageloadTraceContext = pageloadEvent.contexts?.trace; | ||
|
||
expect(pageloadEvent.type).toEqual('transaction'); | ||
|
||
expect(pageloadTraceContext).toMatchObject({ | ||
op: 'pageload', | ||
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/), | ||
span_id: expect.stringMatching(/^[0-9a-f]{16}$/), | ||
}); | ||
expect(pageloadTraceContext).not.toHaveProperty('parent_span_id'); | ||
|
||
expect(pageloadTraceHeaders).toEqual({ | ||
environment: 'production', | ||
public_key: 'public', | ||
sample_rate: '1', | ||
sampled: 'true', | ||
trace_id: pageloadTraceContext?.trace_id, | ||
}); | ||
|
||
const transactionPromises = getMultipleSentryEnvelopeRequests<EventAndTraceHeader>( | ||
page, | ||
2, | ||
{ envelopeType: 'transaction' }, | ||
eventAndTraceHeaderRequestParser, | ||
); | ||
|
||
await page.locator('#newTrace').click(); | ||
await page.locator('#oldTrace').click(); | ||
|
||
const [txnEvent1, txnEvent2] = await transactionPromises; | ||
|
||
const [newTraceTransactionEvent, newTraceTransactionTraceHeaders] = | ||
txnEvent1[0].transaction === 'new-trace' ? txnEvent1 : txnEvent2; | ||
const [oldTraceTransactionEvent, oldTraceTransactionTraceHeaders] = | ||
txnEvent1[0].transaction === 'old-trace' ? txnEvent1 : txnEvent2; | ||
|
||
const newTraceTransactionTraceContext = newTraceTransactionEvent.contexts?.trace; | ||
expect(newTraceTransactionTraceContext).toMatchObject({ | ||
op: 'ui.interaction.click', | ||
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/), | ||
span_id: expect.stringMatching(/^[0-9a-f]{16}$/), | ||
}); | ||
|
||
expect(newTraceTransactionTraceHeaders).toEqual({ | ||
environment: 'production', | ||
public_key: 'public', | ||
sample_rate: '1', | ||
sampled: 'true', | ||
trace_id: newTraceTransactionTraceContext?.trace_id, | ||
transaction: 'new-trace', | ||
}); | ||
|
||
const oldTraceTransactionEventTraceContext = oldTraceTransactionEvent.contexts?.trace; | ||
expect(oldTraceTransactionEventTraceContext).toMatchObject({ | ||
op: 'ui.interaction.click', | ||
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/), | ||
span_id: expect.stringMatching(/^[0-9a-f]{16}$/), | ||
}); | ||
|
||
expect(oldTraceTransactionTraceHeaders).toEqual({ | ||
environment: 'production', | ||
public_key: 'public', | ||
sample_rate: '1', | ||
sampled: 'true', | ||
trace_id: oldTraceTransactionTraceHeaders?.trace_id, | ||
// transaction: 'old-trace', <-- this is not in the DSC because the DSC is continued from the pageload transaction | ||
// which does not have a `transaction` field because its source is URL. | ||
}); | ||
|
||
expect(oldTraceTransactionEventTraceContext?.trace_id).toEqual(pageloadTraceContext?.trace_id); | ||
expect(newTraceTransactionTraceContext?.trace_id).not.toEqual(pageloadTraceContext?.trace_id); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
dev-packages/e2e-tests/test-applications/nextjs-15/app/ppr-error/[param]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
export default async function Page({ | ||
searchParams, | ||
}: { | ||
searchParams: { id?: string }; | ||
}) { | ||
try { | ||
console.log(searchParams.id); // Accessing a field on searchParams will throw the PPR error | ||
} catch (e) { | ||
Sentry.captureException(e); // This error should not be reported | ||
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for any async event processors to run | ||
await Sentry.flush(); | ||
throw e; | ||
} | ||
|
||
return <div>This server component will throw a PPR error that we do not want to catch.</div>; | ||
} |
6 changes: 5 additions & 1 deletion
6
dev-packages/e2e-tests/test-applications/nextjs-15/next.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.