@@ -21,13 +21,16 @@ export function sampleTransaction<T extends Transaction>(
2121) : T {
2222 // nothing to do if tracing is not enabled
2323 if ( ! hasTracingEnabled ( options ) ) {
24+ // eslint-disable-next-line deprecation/deprecation
2425 transaction . sampled = false ;
2526 return transaction ;
2627 }
2728
2829 // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that
30+ // eslint-disable-next-line deprecation/deprecation
2931 if ( transaction . sampled !== undefined ) {
3032 transaction . setMetadata ( {
33+ // eslint-disable-next-line deprecation/deprecation
3134 sampleRate : Number ( transaction . sampled ) ,
3235 } ) ;
3336 return transaction ;
@@ -60,6 +63,7 @@ export function sampleTransaction<T extends Transaction>(
6063 // only valid values are booleans or numbers between 0 and 1.)
6164 if ( ! isValidSampleRate ( sampleRate ) ) {
6265 DEBUG_BUILD && logger . warn ( '[Tracing] Discarding transaction because of invalid sample rate.' ) ;
66+ // eslint-disable-next-line deprecation/deprecation
6367 transaction . sampled = false ;
6468 return transaction ;
6569 }
@@ -74,15 +78,18 @@ export function sampleTransaction<T extends Transaction>(
7478 : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'
7579 } `,
7680 ) ;
81+ // eslint-disable-next-line deprecation/deprecation
7782 transaction . sampled = false ;
7883 return transaction ;
7984 }
8085
8186 // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is
8287 // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.
88+ // eslint-disable-next-line deprecation/deprecation
8389 transaction . sampled = Math . random ( ) < ( sampleRate as number | boolean ) ;
8490
8591 // if we're not going to keep it, we're done
92+ // eslint-disable-next-line deprecation/deprecation
8693 if ( ! transaction . sampled ) {
8794 DEBUG_BUILD &&
8895 logger . log (
0 commit comments