File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ function sample<T extends Transaction>(
55
55
// if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that
56
56
if ( transaction . sampled !== undefined ) {
57
57
transaction . setMetadata ( {
58
- transactionSampling : { method : 'explicitly_set' } ,
58
+ transactionSampling : {
59
+ method : 'explicitly_set' ,
60
+ rate : Number ( transaction . sampled ) ,
61
+ } ,
59
62
} ) ;
60
63
return transaction ;
61
64
}
Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ describe('Hub', () => {
243
243
hub . startTransaction ( { name : 'dogpark' , sampled : true } ) ;
244
244
245
245
expect ( Transaction . prototype . setMetadata ) . toHaveBeenCalledWith ( {
246
- transactionSampling : { method : 'explicitly_set' } ,
246
+ transactionSampling : { method : 'explicitly_set' , rate : 1.0 } ,
247
247
} ) ;
248
248
} ) ;
249
249
You can’t perform that action at this time.
0 commit comments