-
-
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.
feat!: Remove
spanId
from propagation context (#14733)
Closes #12385 This also deprecates `getPropagationContextFromSpan` as it is no longer used/needed. We may think about removing this in v9, but IMHO we can also just leave this for v9, it does not hurt too much to have it in there... --------- Co-authored-by: Luca Forstner <[email protected]>
- Loading branch information
Showing
38 changed files
with
190 additions
and
401 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...ration-tests/suites/public-api/startSpan/parallel-root-spans-with-parentSpanId/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
12 changes: 12 additions & 0 deletions
12
...rowser-integration-tests/suites/tracing/browserTracingIntegration/twp-errors-meta/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,12 @@ | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
window.Sentry = Sentry; | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
integrations: integrations => { | ||
integrations.push(Sentry.browserTracingIntegration()); | ||
return integrations.filter(i => i.name !== 'BrowserSession'); | ||
}, | ||
tracesSampleRate: 0, | ||
}); |
2 changes: 2 additions & 0 deletions
2
...ser-integration-tests/suites/tracing/browserTracingIntegration/twp-errors-meta/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,2 @@ | ||
Sentry.captureException(new Error('test error')); | ||
Sentry.captureException(new Error('test error 2')); |
11 changes: 11 additions & 0 deletions
11
...-integration-tests/suites/tracing/browserTracingIntegration/twp-errors-meta/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,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="sentry-trace" content="12312012123120121231201212312012-1121201211212012" /> | ||
<meta | ||
name="baggage" | ||
content="sentry-release=2.1.12,sentry-public_key=public,sentry-trace_id=123" | ||
/> | ||
</head> | ||
</html> |
35 changes: 35 additions & 0 deletions
35
...rowser-integration-tests/suites/tracing/browserTracingIntegration/twp-errors-meta/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,35 @@ | ||
import { expect } from '@playwright/test'; | ||
import type { Event } from '@sentry/browser'; | ||
import { sentryTest } from '../../../../utils/fixtures'; | ||
import { getMultipleSentryEnvelopeRequests, shouldSkipTracingTest } from '../../../../utils/helpers'; | ||
|
||
sentryTest('errors in TwP mode have same trace ID & span IDs', async ({ getLocalTestUrl, page }) => { | ||
if (shouldSkipTracingTest()) { | ||
sentryTest.skip(); | ||
} | ||
|
||
const traceId = '12312012123120121231201212312012'; | ||
const spanId = '1121201211212012'; | ||
|
||
const url = await getLocalTestUrl({ testDir: __dirname }); | ||
const [event1, event2] = await getMultipleSentryEnvelopeRequests<Event>(page, 2, { url }); | ||
|
||
// Ensure these are the actual errors we care about | ||
expect(event1.exception?.values?.[0].value).toContain('test error'); | ||
expect(event2.exception?.values?.[0].value).toContain('test error'); | ||
|
||
const contexts1 = event1.contexts; | ||
const { trace_id: traceId1, span_id: spanId1 } = contexts1?.trace || {}; | ||
expect(traceId1).toEqual(traceId); | ||
|
||
// Span ID is a virtual span, not the propagated one | ||
expect(spanId1).not.toEqual(spanId); | ||
expect(spanId1).toMatch(/^[a-f0-9]{16}$/); | ||
|
||
const contexts2 = event2.contexts; | ||
const { trace_id: traceId2, span_id: spanId2 } = contexts2?.trace || {}; | ||
expect(traceId2).toEqual(traceId); | ||
expect(spanId2).toMatch(/^[a-f0-9]{16}$/); | ||
|
||
expect(spanId2).toEqual(spanId1); | ||
}); |
12 changes: 12 additions & 0 deletions
12
...ges/browser-integration-tests/suites/tracing/browserTracingIntegration/twp-errors/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,12 @@ | ||
import * as Sentry from '@sentry/browser'; | ||
|
||
window.Sentry = Sentry; | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
integrations: integrations => { | ||
integrations.push(Sentry.browserTracingIntegration()); | ||
return integrations.filter(i => i.name !== 'BrowserSession'); | ||
}, | ||
tracesSampleRate: 0, | ||
}); |
2 changes: 2 additions & 0 deletions
2
.../browser-integration-tests/suites/tracing/browserTracingIntegration/twp-errors/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,2 @@ | ||
Sentry.captureException(new Error('test error')); | ||
Sentry.captureException(new Error('test error 2')); |
30 changes: 30 additions & 0 deletions
30
...ges/browser-integration-tests/suites/tracing/browserTracingIntegration/twp-errors/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,30 @@ | ||
import { expect } from '@playwright/test'; | ||
import type { Event } from '@sentry/browser'; | ||
import { sentryTest } from '../../../../utils/fixtures'; | ||
import { getMultipleSentryEnvelopeRequests, shouldSkipTracingTest } from '../../../../utils/helpers'; | ||
|
||
sentryTest('errors in TwP mode have same trace ID & span IDs', async ({ getLocalTestUrl, page }) => { | ||
if (shouldSkipTracingTest()) { | ||
sentryTest.skip(); | ||
} | ||
|
||
const url = await getLocalTestUrl({ testDir: __dirname }); | ||
const [event1, event2] = await getMultipleSentryEnvelopeRequests<Event>(page, 2, { url }); | ||
|
||
// Ensure these are the actual errors we care about | ||
expect(event1.exception?.values?.[0].value).toContain('test error'); | ||
expect(event2.exception?.values?.[0].value).toContain('test error'); | ||
|
||
const contexts1 = event1.contexts; | ||
const { trace_id: traceId1, span_id: spanId1 } = contexts1?.trace || {}; | ||
expect(traceId1).toMatch(/^[a-f0-9]{32}$/); | ||
expect(spanId1).toMatch(/^[a-f0-9]{16}$/); | ||
|
||
const contexts2 = event2.contexts; | ||
const { trace_id: traceId2, span_id: spanId2 } = contexts2?.trace || {}; | ||
expect(traceId2).toMatch(/^[a-f0-9]{32}$/); | ||
expect(spanId2).toMatch(/^[a-f0-9]{16}$/); | ||
|
||
expect(traceId2).toEqual(traceId1); | ||
expect(spanId2).toEqual(spanId1); | ||
}); |
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
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
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
Oops, something went wrong.