In-memory implementation of AISpan

Implements

  • AISpan

Constructors

  • Parameters

    • name: string
    • type: SpanType
    • Optional_parentSpan: AISpan
    • OptionalonEnd: (span: AISpan) => void

    Returns InMemorySpan

Methods

  • Set an attribute on the span

    Parameters

    • key: string
    • value: string | number | boolean

    Returns void

  • Set multiple attributes

    Parameters

    • attributes: Record<string, string | number | boolean>

    Returns void

  • Set span status

    Parameters

    • status: SpanStatus
    • Optionalmessage: string

    Returns void

Properties

id: string

Unique identifier for this span

name: string

Span name

type: SpanType

Span type

startTime: Date

Start time

endTime?: Date

End time (set when span is completed)

durationMs?: number

Span duration in milliseconds

status: SpanStatus = 'unset'

Span status

error?: Error

Error if span failed

attributes: Record<string, string | number | boolean> = {}

Span attributes (metadata)