Interface ISpan

Represents a single trace span.

interface ISpan {
    name: string;
    context: TraceContext;
    kind: SpanKind;
    startTime: number;
    endTime?: number;
    status: SpanStatus;
    statusMessage?: string;
    attributes: SpanAttributes;
    events: SpanEvent[];
    links: SpanLink[];
    setAttribute(key, value): void;
    setAttributes(attributes): void;
    addEvent(name, attributes?): void;
    setStatus(status, message?): void;
    recordException(error): void;
    end(): void;
    isRecording(): boolean;
}

Methods

Properties

name: string

Span name

context: TraceContext

Trace context

kind: SpanKind

Span kind

startTime: number

Start timestamp in milliseconds

endTime?: number

End timestamp in milliseconds

status: SpanStatus

Span status

statusMessage?: string

Status message

attributes: SpanAttributes

Span attributes

events: SpanEvent[]

Span events

links: SpanLink[]

Links to other spans