Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OpenCensusSpanWrapper

Package version

An implementation of OpenTelemetry Span that wraps an OpenCensus Span.

Hierarchy

  • OpenCensusSpanWrapper

Implements

Index

Constructors

constructor

  • Wraps an existing OpenCensus Span

    Parameters

    • span: OpenCensusSpan

      A Span or RootSpan from OpenCensus

    Returns OpenCensusSpanWrapper

  • Create a new OpenCensus Span and wrap it.

    Parameters

    • tracer: OpenCensusTracerWrapper

      The OpenCensus tracer that has been wrapped in OpenCensusTracerWrapper

    • name: string

      The name of the Span

    • Optional options: SpanOptions

      Options for the Span

    Returns OpenCensusSpanWrapper

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

  • 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

  • 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

    Returns void

getWrappedSpan

  • getWrappedSpan(): OpenCensusSpan
  • The underlying OpenCensus Span

    Returns OpenCensusSpan

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

  • Sets attributes on the Span

    Parameters

    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