1 | import { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';
|
2 | import { Span, SpanContext } from './span';
|
3 | /**
|
4 | * Interface holding Transaction-specific properties
|
5 | */
|
6 | export interface TransactionContext extends SpanContext {
|
7 | /**
|
8 | * Human-readable identifier for the transaction
|
9 | */
|
10 | name: string;
|
11 | /**
|
12 | * If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
|
13 | * the duration of the transaction. This is useful to discard extra time in the transaction that is not
|
14 | * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
|
15 | * transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
|
16 | */
|
17 | trimEnd?: boolean;
|
18 | /**
|
19 | * If this transaction has a parent, the parent's sampling decision
|
20 | */
|
21 | parentSampled?: boolean;
|
22 | /**
|
23 | * Metadata associated with the transaction, for internal SDK use.
|
24 | */
|
25 | metadata?: TransactionMetadata;
|
26 | }
|
27 | /**
|
28 | * Data pulled from a `sentry-trace` header
|
29 | */
|
30 | export declare type TraceparentData = Pick<TransactionContext, 'traceId' | 'parentSpanId' | 'parentSampled'>;
|
31 | /**
|
32 | * Transaction "Class", inherits Span only has `setName`
|
33 | */
|
34 | export interface Transaction extends TransactionContext, Span {
|
35 | /**
|
36 | * @inheritDoc
|
37 | */
|
38 | spanId: string;
|
39 | /**
|
40 | * @inheritDoc
|
41 | */
|
42 | traceId: string;
|
43 | /**
|
44 | * @inheritDoc
|
45 | */
|
46 | startTimestamp: number;
|
47 | /**
|
48 | * @inheritDoc
|
49 | */
|
50 | tags: {
|
51 | [key: string]: Primitive;
|
52 | };
|
53 | /**
|
54 | * @inheritDoc
|
55 | */
|
56 | data: {
|
57 | [key: string]: any;
|
58 | };
|
59 | /**
|
60 | * Metadata about the transaction
|
61 | */
|
62 | metadata: TransactionMetadata;
|
63 | /**
|
64 | * Set the name of the transaction
|
65 | */
|
66 | setName(name: string): void;
|
67 | /** Returns the current transaction properties as a `TransactionContext` */
|
68 | toContext(): TransactionContext;
|
69 | /** Updates the current transaction with a new `TransactionContext` */
|
70 | updateWithContext(transactionContext: TransactionContext): this;
|
71 | }
|
72 | /**
|
73 | * Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
|
74 | */
|
75 | export interface CustomSamplingContext {
|
76 | [key: string]: any;
|
77 | }
|
78 | /**
|
79 | * Data passed to the `tracesSampler` function, which forms the basis for whatever decisions it might make.
|
80 | *
|
81 | * Adds default data to data provided by the user. See {@link Hub.startTransaction}
|
82 | */
|
83 | export interface SamplingContext extends CustomSamplingContext {
|
84 | /**
|
85 | * Context data with which transaction being sampled was created
|
86 | */
|
87 | transactionContext: TransactionContext;
|
88 | /**
|
89 | * Sampling decision from the parent transaction, if any.
|
90 | */
|
91 | parentSampled?: boolean;
|
92 | /**
|
93 | * Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`
|
94 | * integration.
|
95 | */
|
96 | location?: WorkerLocation;
|
97 | /**
|
98 | * Object representing the incoming request to a node server. Passed by default when using the TracingHandler.
|
99 | */
|
100 | request?: ExtractedNodeRequestData;
|
101 | }
|
102 | export declare type Measurements = Record<string, {
|
103 | value: number;
|
104 | }>;
|
105 | export declare enum TransactionSamplingMethod {
|
106 | Explicit = "explicitly_set",
|
107 | Sampler = "client_sampler",
|
108 | Rate = "client_rate",
|
109 | Inheritance = "inheritance"
|
110 | }
|
111 | export interface TransactionMetadata {
|
112 | transactionSampling?: {
|
113 | rate?: number;
|
114 | method?: string;
|
115 | };
|
116 | /** The two halves (sentry and third-party) of a transaction's tracestate header, used for dynamic sampling */
|
117 | tracestate?: {
|
118 | sentry?: string;
|
119 | thirdparty?: string;
|
120 | };
|
121 | /** For transactions tracing server-side request handling, the path of the request being tracked. */
|
122 | requestPath?: string;
|
123 | }
|
124 | //# sourceMappingURL=transaction.d.ts.map |
\ | No newline at end of file |