Options
All
  • Public
  • Public/Protected
  • All
Menu

@azure/opentelemetry-instrumentation-azure-sdk

Package version

Index

Type aliases

SpanKindMapping

SpanKindMapping: { client: SpanKind.CLIENT; consumer: SpanKind.CONSUMER; internal: SpanKind.INTERNAL; producer: SpanKind.PRODUCER; server: SpanKind.SERVER }

A mapping between our {@link TracingSpanKind} union type and OpenTelemetry's {@link SpanKind}.

Type declaration

  • client: SpanKind.CLIENT
  • consumer: SpanKind.CONSUMER
  • internal: SpanKind.INTERNAL
  • producer: SpanKind.PRODUCER
  • server: SpanKind.SERVER

Variables

Const SDK_VERSION

SDK_VERSION: string = "1.0.0-beta.1"

Const logger

logger: any = createClientLogger("opentelemetry-instrumentation-azure-sdk")

The @azure/logger configuration for this package.

Const propagator

propagator: any = new W3CTraceContextPropagator()

type

type: any

Functions

createAzureSdkInstrumentation

  • Enables Azure SDK Instrumentation using OpenTelemetry for Azure SDK client libraries.

    When registerd, any Azure data plane package will begin emitting tracing spans for internal calls as well as network calls

    Example usage:

    const openTelemetryInstrumentation = require("@opentelemetry/instrumentation");
    openTelemetryInstrumentation.registerInstrumentations({
      instrumentations: [createAzureSdkInstrumentation()],
    })
    remarks

    As OpenTelemetry instrumentations rely on patching required modules, you should register this instrumentation as early as possible and before loading any Azure Client Libraries.

    Parameters

    Returns Instrumentation

toOpenTelemetryLinks

  • toOpenTelemetryLinks(spanLinks?: TracingSpanLink[]): Link[]
  • Converts core-tracing's TracingSpanLink to OpenTelemetry's Link

    Parameters

    • Default value spanLinks: TracingSpanLink[] = []

      The core tracing {@link TracingSpanLink} to convert

    Returns Link[]

    A set of {@link Link}s

toOpenTelemetrySpanAttributes

  • toOpenTelemetrySpanAttributes(spanAttributes: {} | undefined): SpanAttributes
  • Converts core-tracing's span attributes to OpenTelemetry attributes.

    Parameters

    • spanAttributes: {} | undefined

      The set of attributes to convert.

    Returns SpanAttributes

    An {@link SpanAttributes} to set on a span.

toOpenTelemetrySpanKind

  • toOpenTelemetrySpanKind<K>(tracingSpanKind?: K): SpanKindMapping[K]
  • Converts our TracingSpanKind to the corresponding OpenTelemetry SpanKind.

    By default it will return {@link SpanKind.INTERNAL}

    Type parameters

    • K: TracingSpanKind

    Parameters

    • Optional tracingSpanKind: K

      The core tracing {@link TracingSpanKind}

    Returns SpanKindMapping[K]

    • The OpenTelemetry {@link SpanKind}

toSpanOptions

  • toSpanOptions(spanOptions?: InstrumenterSpanOptions): SpanOptions
  • Converts core-tracing span options to OpenTelemetry options.

    Parameters

    • Optional spanOptions: InstrumenterSpanOptions

      The {@link InstrumenterSpanOptions} to convert.

    Returns SpanOptions

    An OpenTelemetry {@link SpanOptions} that can be used when creating a span.

Generated using TypeDoc