-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathsamplingcontext.ts
47 lines (40 loc) · 1.39 KB
/
samplingcontext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import type { ExtractedNodeRequestData, WorkerLocation } from './misc';
import type { SpanAttributes } from './span';
/**
* Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
*/
export interface CustomSamplingContext {
[key: string]: any;
}
/**
* Data passed to the `tracesSampler` function, which forms the basis for whatever decisions it might make.
*
* Adds default data to data provided by the user. See {@link Hub.startTransaction}
*/
export interface SamplingContext extends CustomSamplingContext {
/**
* Context data with which transaction being sampled was created.
* @deprecated This is duplicate data and will be removed eventually.
*/
transactionContext: {
name: string;
parentSampled?: boolean | undefined;
};
/**
* Sampling decision from the parent transaction, if any.
*/
parentSampled?: boolean;
/**
* Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`
* integration.
*/
location?: WorkerLocation;
/**
* Object representing the incoming request to a node server. Passed by default when using the TracingHandler.
*/
request?: ExtractedNodeRequestData;
/** The name of the span being sampled. */
name: string;
/** Initial attributes that have been passed to the span being sampled. */
attributes?: SpanAttributes;
}