Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NoOpSpan

Package version

A no-op implementation of Span that can safely be used without side-effects.

Hierarchy

Implements

  • Span

Index

Methods

addEvent

  • addEvent(_name: string, _attributes?: Attributes): this
  • Adds an event to the Span

    Parameters

    • _name: string

      The name of the event

    • Optional _attributes: Attributes

      The associated attributes to add for this event

    Returns this

addLink

  • addLink(_spanContext: SpanContext, _attributes?: Attributes): this
  • Adds a link to the Span.

    Parameters

    • _spanContext: SpanContext

      the context of the linked span

    • Optional _attributes: Attributes

      attributes to be added that are associated with the link

    Returns this

context

  • context(): SpanContext
  • Returns the SpanContext associated with this Span.

    Returns SpanContext

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

isRecordingEvents

  • isRecordingEvents(): boolean
  • Returns whether this span will be recorded

    Returns boolean

setAttribute

  • setAttribute(_key: string, _value: unknown): this
  • Sets an attribute on the Span

    Parameters

    • _key: string

      the attribute key

    • _value: unknown

      the attribute value

    Returns this

setAttributes

  • setAttributes(_attributes: Attributes): this
  • Sets attributes on the Span

    Parameters

    • _attributes: Attributes

      the attributes to add

    Returns this

setStatus

  • setStatus(_status: Status): this
  • Sets a status on the span. Overrides the default of CanonicalCode.OK.

    Parameters

    • _status: Status

      The status to set.

    Returns this

updateName

  • updateName(_name: string): this
  • Updates the name of the Span

    Parameters

    • _name: string

      the new Span name

    Returns this

Generated using TypeDoc