UNPKG

applicationinsights

Version:
67 lines (66 loc) 1.99 kB
/** * Type of span. Can be used to specify additional relationships between spans * in addition to a parent/child relationship. */ export declare enum SpanKind { /** Default value. Indicates that the span is used internally. */ INTERNAL = 0, /** * Indicates that the span covers server-side handling of an RPC or other * remote request. */ SERVER = 1, /** * Indicates that the span covers the client-side wrapper around an RPC or * other remote request. */ CLIENT = 2, /** * Indicates that the span describes producer sending a message to a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ PRODUCER = 3, /** * Indicates that the span describes consumer receiving a message from a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ CONSUMER = 4, } export interface Link { /** The {@link SpanContext} of a linked span. */ spanContext: SpanContext; /** A set of {@link Attributes} on the link. */ attributes?: Record<string, string>; } export interface SpanContext { traceId: string; spanId: string; traceFlags?: { toString: () => string; }; tracestate?: string; } export interface Span { _duration: [number, number]; name: string; parentSpanId?: string; status: { code: number; message?: string; }; attributes: Record<string, string>; kind: SpanKind; links: Link[]; context: () => SpanContext; } export declare class OpenTelemetryScopeManagerWrapper { active(): any; with(span: Span, fn: () => any): any; bind<T>(target: T): T; enable(): this; disable(): this; private static _spanToContext(span, parentSpanId?, name?); } export declare const AsyncScopeManager: OpenTelemetryScopeManagerWrapper;