datadog

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package datadog implements the Datadog APM traces compatible TextMapPropagator.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToDatadogID

func ToDatadogID(otelID string) string

ToDatadogID converts the ID that comes from OpenTelemetry SDK to Datadog ID.

func ToOpenTelemetryID

func ToOpenTelemetryID(ddID string) (string, error)

ToOpenTelemetryID converts the ID that comes from Datadog APM traces to OpenTelemetry ID.

It may fail if the ID has invalid format.

Types

type Propagator

type Propagator struct{}

Propagator serializes Span Context to/from Datadog APM traces headers.

Example
package main

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

func main() {
	otel.SetTextMapPropagator(datadog.Propagator{})
}
Output:

func (Propagator) Extract

Extract gets a context from the carrier if it contains Datadog APM traces headers.

func (Propagator) Fields

func (Propagator) Fields() []string

Fields returns a list of fields used by HTTPTextFormat.

func (Propagator) Inject

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

Inject injects a context to the carreir following Datadog APM traces format.

Jump to

Keyboard shortcuts

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