4
4
CustomSamplingContext ,
5
5
Integration ,
6
6
IntegrationClass ,
7
+ Options ,
7
8
SamplingContext ,
8
9
TransactionContext ,
9
10
} from '@sentry/types' ;
@@ -41,7 +42,11 @@ function traceHeaders(this: Hub): { [key: string]: string } {
41
42
*
42
43
* @returns The given transaction with its `sampled` value set
43
44
*/
44
- function sample < T extends Transaction > ( transaction : T , options : ClientOptions , samplingContext : SamplingContext ) : T {
45
+ function sample < T extends Transaction > (
46
+ transaction : T ,
47
+ options : Pick < Options , 'tracesSampleRate' | 'tracesSampler' > ,
48
+ samplingContext : SamplingContext ,
49
+ ) : T {
45
50
// nothing to do if tracing is not enabled
46
51
if ( ! hasTracingEnabled ( options ) ) {
47
52
transaction . sampled = false ;
@@ -174,7 +179,7 @@ function _startTransaction(
174
179
const options : Partial < ClientOptions > = ( client && client . getOptions ( ) ) || { } ;
175
180
176
181
let transaction = new Transaction ( transactionContext , this ) ;
177
- transaction = sample ( transaction , options as ClientOptions , {
182
+ transaction = sample ( transaction , options , {
178
183
parentSampled : transactionContext . parentSampled ,
179
184
transactionContext,
180
185
...customSamplingContext ,
@@ -199,7 +204,7 @@ export function startIdleTransaction(
199
204
const options : Partial < ClientOptions > = ( client && client . getOptions ( ) ) || { } ;
200
205
201
206
let transaction = new IdleTransaction ( transactionContext , hub , idleTimeout , onScope ) ;
202
- transaction = sample ( transaction , options as ClientOptions , {
207
+ transaction = sample ( transaction , options , {
203
208
parentSampled : transactionContext . parentSampled ,
204
209
transactionContext,
205
210
...customSamplingContext ,
0 commit comments