Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HttpTextFormat

Package version

Injects and extracts a value as text into carriers that travel in-band across process boundaries. Encoding is expected to conform to the HTTP Header Field semantics. Values are often encoded as RPC/HTTP request headers.

The carrier of propagated data on both the client (injector) and server (extractor) side is usually an http request. Propagation is usually implemented via library- specific request interceptors, where the client-side injects values and the server-side extracts them.

Hierarchy

  • HttpTextFormat

Index

Methods

Methods

extract

  • extract(format: string, carrier: unknown): SpanContext | null
  • Returns a SpanContext instance extracted from carrier in the given format from upstream.

    Parameters

    • format: string

      the format of the carrier.

    • carrier: unknown

      the carrier of propagation fields, such as an http request.

    Returns SpanContext | null

    SpanContext The extracted SpanContext, or null if no such SpanContext could be found in carrier.

inject

  • inject(spanContext: SpanContext, format: string, carrier: unknown): void
  • Injects the given SpanContext instance to transmit over the wire.

    OpenTelemetry defines a common set of format values (BinaryFormat and HTTPTextFormat), and each has an expected carrier type.

    Parameters

    • spanContext: SpanContext

      the SpanContext to transmit over the wire.

    • format: string

      the format of the carrier.

    • carrier: unknown

      the carrier of propagation fields, such as an http request.

    Returns void

Generated using TypeDoc