trace

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTraceExtractor = getHeadersFromEventHeaders

DefaultTraceExtractor is the default trace extractor. Extracts root trace from API Gateway headers.

Functions

func ConvertTraceContextToSpanContext added in v0.9.1

func ConvertTraceContextToSpanContext(traceCtx TraceContext) (ddtrace.SpanContext, error)

ConvertTraceContextToSpanContext converts a TraceContext object to a SpanContext that can be used by dd-trace.

Types

type Config added in v0.9.0

type Config struct {
	DDTraceEnabled           bool
	MergeXrayTraces          bool
	UniversalInstrumentation bool
	OtelTracerEnabled        bool
	TraceContextExtractor    ContextExtractor
}

Config gives options for how the Listener should work

type ContextExtractor added in v1.2.0

type ContextExtractor func(ctx context.Context, ev json.RawMessage) map[string]string

ContextExtractor is a func type for extracting a root TraceContext.

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

Listener creates a function execution span and injects it into the context

func MakeListener added in v0.9.0

func MakeListener(config Config, extensionManager *extension.ExtensionManager) Listener

MakeListener initializes a new trace lambda Listener

func (*Listener) HandlerFinished

func (l *Listener) HandlerFinished(ctx context.Context, err error)

HandlerFinished ends the function execution span and stops the tracer

func (*Listener) HandlerStarted

func (l *Listener) HandlerStarted(ctx context.Context, msg json.RawMessage) context.Context

HandlerStarted sets up tracing and starts the function execution span if Datadog tracing is enabled

type TraceContext added in v0.9.0

type TraceContext map[string]string

TraceContext is map of headers containing a Datadog trace context.

func ConvertCurrentXrayTraceContext added in v0.9.1

func ConvertCurrentXrayTraceContext(ctx context.Context) TraceContext

ConvertCurrentXrayTraceContext returns the current X-Ray trace context converted to Datadog headers, taking into account the current subsegment. It is designed for sending Datadog trace headers from functions instrumented with the X-Ray SDK.

Jump to

Keyboard shortcuts

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