@@ -86,13 +86,14 @@ function resolveLazyOptions (options, apiMethods, logger) {
8686}
8787
8888/**
89- * @param {import('../../types/sentry').ModuleConfiguration['tracing'] } tracing
89+ * @param {import('../../types/sentry').ModuleConfiguration } options
9090 * @param {NonNullable<import('../../types/sentry').ModuleConfiguration['config']> } config
9191 */
92- function resolveTracingOptions ( tracing , config ) {
93- if ( ! tracing ) {
92+ function resolveTracingOptions ( options , config ) {
93+ if ( ! options . tracing ) {
9494 return
9595 }
96+ const userOptions = typeof options . tracing === 'boolean' ? { } : options . tracing
9697 /** @type {NonNullable<import('../../types/sentry').TracingConfiguration> } */
9798 const tracingOptions = merge (
9899 {
@@ -107,11 +108,12 @@ function resolveTracingOptions (tracing, config) {
107108 } ,
108109 browserOptions : { } ,
109110 } ,
110- typeof tracing === 'boolean' ? { } : tracing ,
111+ userOptions ,
111112 )
112- if ( tracingOptions && ! config . tracesSampleRate ) {
113+ if ( ! config . tracesSampleRate ) {
113114 config . tracesSampleRate = tracingOptions . tracesSampleRate
114115 }
116+ options . tracing = tracingOptions
115117}
116118
117119/**
@@ -128,7 +130,7 @@ export async function resolveClientOptions (moduleContainer, moduleOptions, logg
128130
129131 const apiMethods = await getApiMethods ( '@sentry/browser' )
130132 resolveLazyOptions ( options , apiMethods , logger )
131- resolveTracingOptions ( options . tracing , options . config )
133+ resolveTracingOptions ( options , options . config )
132134
133135 for ( const name of Object . keys ( options . clientIntegrations ) ) {
134136 if ( ! PLUGGABLE_INTEGRATIONS . includes ( name ) && ! BROWSER_INTEGRATIONS . includes ( name ) ) {
@@ -213,7 +215,7 @@ export async function resolveServerOptions (moduleContainer, moduleOptions, logg
213215
214216 const apiMethods = await getApiMethods ( '@sentry/node' )
215217 resolveLazyOptions ( options , apiMethods , logger )
216- resolveTracingOptions ( options . tracing , options . config )
218+ resolveTracingOptions ( options , options . config )
217219
218220 return {
219221 config : options . config ,
0 commit comments