UNPKG

1.51 kBTypeScriptView Raw
1import { isSpanContextValid, wrapSpanContext } from '../trace/spancontext-utils';
2import { Tracer } from '../trace/tracer';
3import { TracerProvider } from '../trace/tracer_provider';
4import { deleteSpan, getSpan, getSpanContext, setSpan, setSpanContext } from '../trace/context-utils';
5/**
6 * Singleton object which represents the entry point to the OpenTelemetry Tracing API
7 */
8export declare class TraceAPI {
9 private static _instance?;
10 private _proxyTracerProvider;
11 /** Empty private constructor prevents end users from constructing a new instance of the API */
12 private constructor();
13 /** Get the singleton instance of the Trace API */
14 static getInstance(): TraceAPI;
15 /**
16 * Set the current global tracer.
17 *
18 * @returns true if the tracer provider was successfully registered, else false
19 */
20 setGlobalTracerProvider(provider: TracerProvider): boolean;
21 /**
22 * Returns the global tracer provider.
23 */
24 getTracerProvider(): TracerProvider;
25 /**
26 * Returns a tracer from the global tracer provider.
27 */
28 getTracer(name: string, version?: string): Tracer;
29 /** Remove the global tracer provider */
30 disable(): void;
31 wrapSpanContext: typeof wrapSpanContext;
32 isSpanContextValid: typeof isSpanContextValid;
33 deleteSpan: typeof deleteSpan;
34 getSpan: typeof getSpan;
35 getSpanContext: typeof getSpanContext;
36 setSpan: typeof setSpan;
37 setSpanContext: typeof setSpanContext;
38}
39//# sourceMappingURL=trace.d.ts.map
\No newline at end of file