UNPKG

2.13 kBTypeScriptView Raw
1import type { Context, DynamicSamplingContext, MeasurementUnit, Transaction as TransactionInterface, TransactionContext, TransactionMetadata } from '@sentry/types';
2import type { Hub } from '../hub';
3import { Span as SpanClass } from './span';
4/** JSDoc */
5export declare class Transaction extends SpanClass implements TransactionInterface {
6 metadata: TransactionMetadata;
7 /**
8 * The reference to the current hub.
9 */
10 readonly _hub: Hub;
11 private _name;
12 private _measurements;
13 private _contexts;
14 private _trimEnd?;
15 private _frozenDynamicSamplingContext;
16 /**
17 * This constructor should never be called manually. Those instrumenting tracing should use
18 * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.
19 * @internal
20 * @hideconstructor
21 * @hidden
22 */
23 constructor(transactionContext: TransactionContext, hub?: Hub);
24 /** Getter for `name` property */
25 get name(): string;
26 /** Setter for `name` property, which also sets `source` as custom */
27 set name(newName: string);
28 /**
29 * JSDoc
30 */
31 setName(name: string, source?: TransactionMetadata['source']): void;
32 /**
33 * Attaches SpanRecorder to the span itself
34 * @param maxlen maximum number of spans that can be recorded
35 */
36 initSpanRecorder(maxlen?: number): void;
37 /**
38 * @inheritDoc
39 */
40 setContext(key: string, context: Context | null): void;
41 /**
42 * @inheritDoc
43 */
44 setMeasurement(name: string, value: number, unit?: MeasurementUnit): void;
45 /**
46 * @inheritDoc
47 */
48 setMetadata(newMetadata: Partial<TransactionMetadata>): void;
49 /**
50 * @inheritDoc
51 */
52 finish(endTimestamp?: number): string | undefined;
53 /**
54 * @inheritDoc
55 */
56 toContext(): TransactionContext;
57 /**
58 * @inheritDoc
59 */
60 updateWithContext(transactionContext: TransactionContext): this;
61 /**
62 * @inheritdoc
63 *
64 * @experimental
65 */
66 getDynamicSamplingContext(): Readonly<Partial<DynamicSamplingContext>>;
67}
68//# sourceMappingURL=transaction.d.ts.map
\No newline at end of file