UNPKG

1.66 kBTypeScriptView Raw
1import type { Span, StartSpanOptions } from '@sentry/types';
2export declare const TRACING_DEFAULTS: {
3 idleTimeout: number;
4 finalTimeout: number;
5 childSpanTimeout: number;
6};
7interface IdleSpanOptions {
8 /**
9 * The time that has to pass without any span being created.
10 * If this time is exceeded, the idle span will finish.
11 */
12 idleTimeout: number;
13 /**
14 * The max. time an idle span may run.
15 * If this time is exceeded, the idle span will finish no matter what.
16 */
17 finalTimeout: number;
18 /**
19 * The max. time a child span may run.
20 * If the time since the last span was started exceeds this time, the idle span will finish.
21 */
22 childSpanTimeout?: number;
23 /**
24 * When set to `true`, will disable the idle timeout and child timeout
25 * until the `idleSpanEnableAutoFinish` hook is emitted for the idle span.
26 * The final timeout mechanism will not be affected by this option,
27 * meaning the idle span will definitely be finished when the final timeout is
28 * reached, no matter what this option is configured to.
29 *
30 * Defaults to `false`.
31 */
32 disableAutoFinish?: boolean;
33 /** Allows to configure a hook that is called when the idle span is ended, before it is processed. */
34 beforeSpanEnd?: (span: Span) => void;
35}
36/**
37 * An idle span is a span that automatically finishes. It does this by tracking child spans as activities.
38 * An idle span is always the active span.
39 */
40export declare function startIdleSpan(startSpanOptions: StartSpanOptions, options?: Partial<IdleSpanOptions>): Span;
41export {};
42//# sourceMappingURL=idleSpan.d.ts.map
\No newline at end of file