1
1
import { getMainCarrier , Hub } from '@sentry/hub' ;
2
2
import {
3
+ ClientOptions ,
3
4
CustomSamplingContext ,
4
5
Integration ,
5
6
IntegrationClass ,
6
- Options ,
7
7
SamplingContext ,
8
8
TransactionContext ,
9
9
} from '@sentry/types' ;
@@ -41,7 +41,7 @@ function traceHeaders(this: Hub): { [key: string]: string } {
41
41
*
42
42
* @returns The given transaction with its `sampled` value set
43
43
*/
44
- function sample < T extends Transaction > ( transaction : T , options : Options , samplingContext : SamplingContext ) : T {
44
+ function sample < T extends Transaction > ( transaction : T , options : ClientOptions , samplingContext : SamplingContext ) : T {
45
45
// nothing to do if tracing is not enabled
46
46
if ( ! hasTracingEnabled ( options ) ) {
47
47
transaction . sampled = false ;
@@ -171,10 +171,10 @@ function _startTransaction(
171
171
customSamplingContext ?: CustomSamplingContext ,
172
172
) : Transaction {
173
173
const client = this . getClient ( ) ;
174
- const options = ( client && client . getOptions ( ) ) || { } ;
174
+ const options : Partial < ClientOptions > = ( client && client . getOptions ( ) ) || { } ;
175
175
176
176
let transaction = new Transaction ( transactionContext , this ) ;
177
- transaction = sample ( transaction , options , {
177
+ transaction = sample ( transaction , options as ClientOptions , {
178
178
parentSampled : transactionContext . parentSampled ,
179
179
transactionContext,
180
180
...customSamplingContext ,
@@ -196,10 +196,10 @@ export function startIdleTransaction(
196
196
customSamplingContext ?: CustomSamplingContext ,
197
197
) : IdleTransaction {
198
198
const client = hub . getClient ( ) ;
199
- const options = ( client && client . getOptions ( ) ) || { } ;
199
+ const options : Partial < ClientOptions > = ( client && client . getOptions ( ) ) || { } ;
200
200
201
201
let transaction = new IdleTransaction ( transactionContext , hub , idleTimeout , onScope ) ;
202
- transaction = sample ( transaction , options , {
202
+ transaction = sample ( transaction , options as ClientOptions , {
203
203
parentSampled : transactionContext . parentSampled ,
204
204
transactionContext,
205
205
...customSamplingContext ,
0 commit comments