# README

Datadog Trace Context propagator for OpenTelemetry

OpenTelemetry propagators are used to extract and inject context data from and into messages exchanged by applications. The propagator supported by this package is the Datadog Trace Context.

Trace context propagation

Span ContextSizeDD header keySizeText Format
TraceId128 bits<-->x-datadog-trace-id64 bitsnumber base 10
SpanId64 bits<-->x-datadog-parent-id64 bitsnumber base 10
Sampling decision1 bit<-->x-datadog-sampling-prioritybool"0" or "1"

You can find a getting started guide on opentelemetry.io.

Getting Started

go get github.com/SylvainDumas/opentelemetry-datadog-go

If you installed more packages than you intended, you can use go mod tidy to remove any unused packages.

import (
    //...
	"github.com/SylvainDumas/opentelemetry-datadog-go/propagators/tracecontext"
	"go.opentelemetry.io/otel"
)

func initTracerProvider() {
    // ...
	otel.SetTextMapPropagator(tracecontext.NewDefault())
}

Documentation