Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OpenCensusTracerWrapper

Package version

An implementation of OpenTelemetry Tracer that wraps an OpenCensus Tracer.

Hierarchy

  • OpenCensusTracerWrapper

Implements

  • Tracer

Index

Constructors

constructor

  • Create a new wrapper around a given OpenCensus Tracer.

    Parameters

    • tracer: TracerBase

      The OpenCensus Tracer to wrap.

    Returns OpenCensusTracerWrapper

Methods

bind

  • bind<T>(target: T, span?: Span): T
  • Bind a Span as the target's scope

    Type parameters

    • T

    Parameters

    • target: T

      An object to bind the scope.

    • Optional span: Span

      A specific Span to use. Otherwise, use the current one.

    Returns T

getBinaryFormat

  • Returns the BinaryFormat interface for serializing/deserializing Spans.

    Returns BinaryFormat

getCurrentSpan

  • getCurrentSpan(): Span | null
  • Returns the current Span from the current context, if available.

    Returns Span | null

getHttpTextFormat

  • Returns the HttpTextFormat interface for injecting/extracting Spans.

    Returns HttpTextFormat

getWrappedTracer

  • The wrapped OpenCensus Tracer

    Returns TracerBase

recordSpanData

  • recordSpanData(span: Span): void
  • Send a pre-populated Span object to the exporter.

    Parameters

    • span: Span

      The span to pass along.

    Returns void

startSpan

  • Starts a new Span.

    Parameters

    • name: string

      The name of the span.

    • Optional options: SpanOptions

      The SpanOptions used during Span creation.

    Returns Span

withSpan

  • withSpan<T>(span: Span, fn: T): ReturnType<T>
  • Executes the given function within the context provided by a Span.

    Type parameters

    • T: function

    Parameters

    • span: Span

      The span that provides the context.

    • fn: T

      The function to be executed.

    Returns ReturnType<T>

Generated using TypeDoc