tracing

package
v3.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSpan

func ExtractSpan(ctx context.Context) (otelTrace.SpanContext, error)

ExtractSpan retrieves an OpenTelemetry span context from the given context.Context The span context can be received directly (inside the context) or via an RPC call (encoded in a carrier)

func FinishSpan

func FinishSpan(ctx context.Context, err error)

FinishSpan finishes a span retrieved from the given context and logs the error if it exists

func InitializeOtel

func InitializeOtel() error

func InjectSpan

func InjectSpan(ctx context.Context) (context.Context, error)

InjectSpan retrieves an OpenTelemetry span from the current context and creates a new context with it encoded in text map format inside the propagatable context content

func StartSpan

func StartSpan(
	parentCtx context.Context,
	opName string,
	attributes ...attribute.KeyValue,
) (context.Context, trace.Span)

StartSpan starts a new span with a given parent context, operation name, and attributes. It returns a context with the created span.

Types

This section is empty.

Jump to

Keyboard shortcuts

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