ot

package module
v1.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 46

Documentation

Overview

Package ot implements the ot-tracer-* propagator used by the default Tracer implementation from the OpenTracing project.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func SemVersion deprecated added in v0.24.0

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

Deprecated: Use Version instead.

func Version added in v0.24.0

func Version() string

Version is the current release version of the ot propagator.

Types

type OT

type OT struct{}

OT propagator serializes SpanContext to/from ot-trace-* headers.

Example
package main

import (
	"go.opentelemetry.io/contrib/propagators/ot"
	"go.opentelemetry.io/otel"
)

func main() {
	otPropagator := ot.OT{}
	// register ot propagator
	otel.SetTextMapPropagator(otPropagator)
}
Output:

func (OT) Extract

func (o OT) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context

Extract extracts a context from the carrier if it contains OT headers.

func (OT) Fields

func (o OT) Fields() []string

Fields returns the OT header keys whose values are set with Inject.

func (OT) Inject

func (o OT) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject injects a context into the carrier as OT headers. NOTE: In order to interop with systems that use the OT header format, trace ids MUST be 64-bits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL