1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import * as loggerTypes from '../../common/types';
|
17 | import * as configTypes from '../config/types';
|
18 | import { TraceParams } from '../config/types';
|
19 | import { Propagation } from '../propagation/types';
|
20 | import * as samplerTypes from '../sampler/types';
|
21 | import * as types from './types';
|
22 |
|
23 |
|
24 |
|
25 | export declare class CoreTracerBase implements types.TracerBase {
|
26 |
|
27 | private activeLocal;
|
28 |
|
29 | private config;
|
30 |
|
31 | private eventListenersLocal;
|
32 |
|
33 | private readonly IS_SAMPLED;
|
34 |
|
35 | sampler: samplerTypes.Sampler;
|
36 |
|
37 | logger: loggerTypes.Logger;
|
38 |
|
39 | activeTraceParams: TraceParams;
|
40 |
|
41 | constructor();
|
42 | /** A propagation instance */
|
43 | readonly propagation: Propagation;
|
44 | /** Sets the current root span. */
|
45 | setCurrentRootSpan(root: types.Span): void;
|
46 | /**
|
47 | * Starts a tracer.
|
48 | * @param config A tracer configuration object to start a tracer.
|
49 | */
|
50 | start(config: configTypes.TracerConfig): this;
|
51 | /** Stops the tracer. */
|
52 | stop(): this;
|
53 | /** Gets the list of event listeners. */
|
54 | readonly eventListeners: types.SpanEventListener[];
|
55 | /** Indicates if the tracer is active or not. */
|
56 | readonly active: boolean;
|
57 | /**
|
58 | * Starts a root span.
|
59 | * @param options A TraceOptions object to start a root span.
|
60 | * @param fn A callback function to run after starting a root span.
|
61 | */
|
62 | startRootSpan<T>(options: types.TraceOptions, fn: (root: types.Span) => T): T;
|
63 | /** Notifies listeners of the span start. */
|
64 | onStartSpan(span: types.Span): void;
|
65 | /** Notifies listeners of the span end. */
|
66 | onEndSpan(span: types.Span): void;
|
67 | /**
|
68 | * Registers an end span event listener.
|
69 | * @param listener The listener to register.
|
70 | */
|
71 | registerSpanEventListener(listener: types.SpanEventListener): void;
|
72 | /**
|
73 | * Unregisters an end span event listener.
|
74 | * @param listener The listener to unregister.
|
75 | */
|
76 | unregisterSpanEventListener(listener: types.SpanEventListener): void;
|
77 | private notifyStartSpan;
|
78 | private notifyEndSpan;
|
79 | /**
|
80 | * Starts a span.
|
81 | * @param [options] A SpanOptions object to start a child span.
|
82 | */
|
83 | startChildSpan(options?: types.SpanOptions): types.Span;
|
84 | /** Determine whether to sample request or not. */
|
85 | private makeSamplingDecision;
|
86 | }
|