-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(core)!: Enable span streaming by default #22642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,21 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { sentryTest } from '../../../../utils/fixtures'; | ||
| import { | ||
| envelopeRequestParser, | ||
| shouldSkipTracingTest, | ||
| waitForTransactionRequestOnUrl, | ||
| } from '../../../../utils/helpers'; | ||
| import { shouldSkipTracingTest } from '../../../../utils/helpers'; | ||
| import { getSpanOp, waitForStreamedSpan } from '../../../../utils/spanUtils'; | ||
|
|
||
| sentryTest('should create a pageload transaction', async ({ getLocalTestUrl, page }) => { | ||
| sentryTest('should create a pageload span', async ({ getLocalTestUrl, page }) => { | ||
| if (shouldSkipTracingTest()) { | ||
| sentryTest.skip(); | ||
| } | ||
|
|
||
| const spanPromise = waitForStreamedSpan(page, s => getSpanOp(s) === 'pageload'); | ||
| const url = await getLocalTestUrl({ testDir: __dirname }); | ||
| const req = await waitForTransactionRequestOnUrl(page, url); | ||
| await page.goto(url); | ||
| const pageloadSpan = await spanPromise; | ||
|
|
||
| const eventData = envelopeRequestParser(req); | ||
| const timeOrigin = await page.evaluate<number>('window._testBaseTimestamp'); | ||
|
|
||
| const { start_timestamp: startTimestamp } = eventData; | ||
| expect(pageloadSpan.start_timestamp).toBeCloseTo(timeOrigin, 1); | ||
|
|
||
| expect(startTimestamp).toBeCloseTo(timeOrigin, 1); | ||
|
|
||
| expect(eventData.contexts?.trace?.op).toBe('pageload'); | ||
| expect(eventData.spans?.length).toBeGreaterThan(0); | ||
| expect(eventData.transaction_info?.source).toEqual('url'); | ||
| expect(pageloadSpan.attributes?.['sentry.segment.name.source'].value).toEqual('url'); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| "SENTRY_ENVIRONMENT": "qa", | ||
| "SENTRY_TRACES_SAMPLE_RATE": "1.0", | ||
| "SENTRY_TUNNEL": "http://localhost:3031/", | ||
| "SENTRY_TRACE_LIFECYCLE": "static", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The SDK for Astro 3-5 on cloudflare can only be configured via env variables (known issue, see docs). This makes opt-out less intuitive (but still possible). Astro 6 again pulls in the correct |
||
| }, | ||
| "assets": { | ||
| "binding": "ASSETS", | ||
|
|
||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AWS Lambda layer is another case where the opt-out must happen via env variables, as long as users use the auto init. I think this is a fair tradeoff. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ export function createSentryInstance( | |
| dsn: 'https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737', | ||
|
|
||
| tracesSampleRate: 1, | ||
| traceLifecycle: 'static', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. decided to keep bundler plugins' trace lifecycle static as well. We can opt into streaming in a separate PR. This is an interesting case because traces in the plugin have higher chance of actually getting streamed due to the longer execution time. |
||
| sampleRate: 1, | ||
|
|
||
| release: LIB_VERSION, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to migrate this test to span streaming since it specifically tests the
Sentry.init-less loader setup. In this case, the default will be span streaming. The only way to opt-out of it would be to callSentry.initinonload. Doing this in this test would defeat the purpose of thenoOnloadtest scenario 😅