-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(browser): Add support for streamed spans in cultureContextIntegration
#20352
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
d6dedf6
c74fa24
420b283
5c44e55
c216b99
d778740
878ef99
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import * as Sentry from '@sentry/browser'; | ||
|
|
||
| window.Sentry = Sentry; | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| integrations: [Sentry.spanStreamingIntegration(), Sentry.browserTracingIntegration()], | ||
| tracesSampleRate: 1.0, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { sentryTest } from '../../../utils/fixtures'; | ||
| import { getSpanOp, waitForStreamedSpans } from '../../../utils/spanUtils'; | ||
| import { shouldSkipTracingTest, testingCdnBundle } from '../../../utils/helpers'; | ||
|
|
||
| sentryTest('cultureContextIntegration captures locale, timezone, and calendar', async ({ getLocalTestUrl, page }) => { | ||
| sentryTest.skip(shouldSkipTracingTest() || testingCdnBundle()); | ||
| const url = await getLocalTestUrl({ testDir: __dirname }); | ||
|
|
||
| const spansPromise = waitForStreamedSpans(page, spans => spans.some(s => getSpanOp(s) === 'pageload')); | ||
|
|
||
| await page.goto(url); | ||
|
|
||
| const spans = await spansPromise; | ||
|
|
||
| const pageloadSpan = spans.find(s => getSpanOp(s) === 'pageload'); | ||
|
|
||
| expect(pageloadSpan!.attributes?.['culture.locale']).toEqual({ type: 'string', value: expect.any(String) }); | ||
| expect(pageloadSpan!.attributes?.['culture.timezone']).toEqual({ type: 'string', value: expect.any(String) }); | ||
| expect(pageloadSpan!.attributes?.['culture.calendar']).toEqual({ type: 'string', value: expect.any(String) }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import { defineIntegration } from '../integration'; | ||
| import { hasSpanStreamingEnabled } from '../tracing/spans/hasSpanStreamingEnabled'; | ||
|
Member
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. seems like we are not emitting errors for unused imports during linting, should we change that?
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. yeah I brought this up a while ago. +1 for erroring on lint warnings all together tbh
Member
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. yes agreed, seems like warnings usually get ignored so mostly add noise |
||
| import type { Event } from '../types-hoist/event'; | ||
| import type { IntegrationFn } from '../types-hoist/integration'; | ||
| import type { RequestEventData } from '../types-hoist/request'; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.