UNPKG

1.52 kBTypeScriptView Raw
1import type { ExtractedNodeRequestData, WorkerLocation } from './misc';
2import type { SpanAttributes } from './span';
3/**
4 * Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
5 */
6export interface CustomSamplingContext {
7 [key: string]: any;
8}
9/**
10 * Data passed to the `tracesSampler` function, which forms the basis for whatever decisions it might make.
11 *
12 * Adds default data to data provided by the user. See {@link Hub.startTransaction}
13 */
14export interface SamplingContext extends CustomSamplingContext {
15 /**
16 * Context data with which transaction being sampled was created.
17 * @deprecated This is duplicate data and will be removed eventually.
18 */
19 transactionContext: {
20 name: string;
21 parentSampled?: boolean | undefined;
22 };
23 /**
24 * Sampling decision from the parent transaction, if any.
25 */
26 parentSampled?: boolean;
27 /**
28 * Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`
29 * integration.
30 */
31 location?: WorkerLocation;
32 /**
33 * Object representing the incoming request to a node server. Passed by default when using the TracingHandler.
34 */
35 request?: ExtractedNodeRequestData;
36 /** The name of the span being sampled. */
37 name: string;
38 /** Initial attributes that have been passed to the span being sampled. */
39 attributes?: SpanAttributes;
40}
41//# sourceMappingURL=samplingcontext.d.ts.map
\No newline at end of file