MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / applyScopeDataToEvent

Function applyScopeDataToEvent

packages/core/src/utils/scopeData.ts:13–29  ·  view source on GitHub ↗
(event: Event, data: ScopeData)

Source from the content-addressed store, hash-verified

11 * Applies data from the scope to the event and runs all event processors on it.
12 */
13export function applyScopeDataToEvent(event: Event, data: ScopeData): void {
14 const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;
15
16 // Apply general data
17 applyDataToEvent(event, data);
18
19 // We want to set the trace context for normal events only if there isn't already
20 // a trace context on the event. There is a product feature in place where we link
21 // errors with transaction and it relies on that.
22 if (span) {
23 applySpanToEvent(event, span);
24 }
25
26 applyFingerprintToEvent(event, fingerprint);
27 applyBreadcrumbsToEvent(event, breadcrumbs);
28 applySdkMetadataToEvent(event, sdkProcessingMetadata);
29}
30
31/** Merge data of two scopes together. */
32export function mergeScopeData(data: ScopeData, mergeData: ScopeData): void {

Callers 5

scope.test.tsFile · 0.90
scopeData.test.tsFile · 0.90
prepareEventFunction · 0.90
applyScopeToEventFunction · 0.90
applyScopeToEventFunction · 0.90

Calls 5

applyDataToEventFunction · 0.85
applySpanToEventFunction · 0.85
applyFingerprintToEventFunction · 0.85
applyBreadcrumbsToEventFunction · 0.85
applySdkMetadataToEventFunction · 0.85

Tested by

no test coverage detected