Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestSpan

Package version

A mock span useful for testing.

Hierarchy

Implements

Index

Constructors

constructor

  • Starts a new Span.

    Parameters

    • parentTracer: Tracer
    • name: string

      The name of the span.

    • context: SpanContext

      The SpanContext this span belongs to

    • kind: SpanKind

      The SpanKind of this Span

    • Optional parentSpanId: undefined | string

      The identifier of the parent Span

    • Default value startTime: TimeInput = Date.now()

      The startTime of the event (defaults to now)

    Returns TestSpan

Properties

attributes

attributes: SpanAttributes

Known attributes, if any.

endCalled

endCalled: boolean

True if end() has been called on the Span

kind

kind: SpanKind

The Span's kind

name

name: string

The Span's current name

Optional parentSpanId

parentSpanId: undefined | string

The id of the parent Span, if any.

startTime

startTime: TimeInput

The start time of the Span

status

status: SpanStatus

The Span's current status

Methods

addEvent

context

end

  • end(_endTime?: undefined | number): void
  • Marks the end of Span execution.

    Parameters

    • Optional _endTime: undefined | number

      The time to use as the Span's end time. Defaults to the current time.

    Returns void

isRecording

  • isRecording(): boolean

recordException

setAttribute

setAttributes

setStatus

tracer

updateName

  • updateName(_name: string): this

Generated using TypeDoc