@@ -2,10 +2,9 @@ import SentryCli from "@sentry/cli";
2
2
import {
3
3
closeSession ,
4
4
DEFAULT_ENVIRONMENT ,
5
- getDynamicSamplingContextFromSpan ,
5
+ getTraceData ,
6
6
makeSession ,
7
7
setMeasurement ,
8
- spanToTraceHeader ,
9
8
startSpan ,
10
9
} from "@sentry/core" ;
11
10
import * as dotenv from "dotenv" ;
@@ -23,7 +22,6 @@ import { Options, SentrySDKBuildFlags } from "./types";
23
22
import { arrayify , getTurborepoEnvPassthroughWarning , stripQueryAndHashFromPath } from "./utils" ;
24
23
import { glob } from "glob" ;
25
24
import { defaultRewriteSourcesHook , prepareBundleForDebugIdUpload } from "./debug-id-upload" ;
26
- import { dynamicSamplingContextToSentryBaggageHeader } from "@sentry/utils" ;
27
25
28
26
export type SentryBuildPluginManager = {
29
27
/**
@@ -89,10 +87,7 @@ export type SentryBuildPluginManager = {
89
87
createDependencyOnBuildArtifacts : ( ) => ( ) => void ;
90
88
} ;
91
89
92
- function createCliInstance (
93
- options : NormalizedOptions ,
94
- additionalHeaders : Record < string , string > = { }
95
- ) : SentryCli {
90
+ function createCliInstance ( options : NormalizedOptions ) : SentryCli {
96
91
return new SentryCli ( null , {
97
92
authToken : options . authToken ,
98
93
org : options . org ,
@@ -101,8 +96,7 @@ function createCliInstance(
101
96
url : options . url ,
102
97
vcsRemote : options . release . vcsRemote ,
103
98
headers : {
104
- ...options . headers ,
105
- ...additionalHeaders ,
99
+ ...getTraceData ( ) ,
106
100
} ,
107
101
} ) ;
108
102
}
@@ -666,14 +660,8 @@ export function createSentryBuildPluginManager(
666
660
setMeasurement ( "files" , files . length , "none" , prepBundlesSpan ) ;
667
661
setMeasurement ( "upload_size" , uploadSize , "byte" , prepBundlesSpan ) ;
668
662
669
- await startSpan ( { name : "upload" , scope : sentryScope } , async ( uploadSpan ) => {
670
- const cliInstance = createCliInstance ( options , {
671
- "sentry-trace" : spanToTraceHeader ( uploadSpan ) ,
672
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
673
- baggage : dynamicSamplingContextToSentryBaggageHeader (
674
- getDynamicSamplingContextFromSpan ( uploadSpan )
675
- ) ! ,
676
- } ) ;
663
+ await startSpan ( { name : "upload" , scope : sentryScope } , async ( ) => {
664
+ const cliInstance = createCliInstance ( options ) ;
677
665
678
666
await cliInstance . releases . uploadSourceMaps (
679
667
options . release . name ?? "undefined" , // unfortunately this needs a value for now but it will not matter since debug IDs overpower releases anyhow
0 commit comments