tracing

package
v0.0.0-...-dc7611c Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceId      = "general.trace-id"
	SpanId       = "general.span-id"
	ParentSpanId = "general.parent-span-id"
	Traceparent  = "general.traceparent"
	Timestamp    = "general.timestamp"
	ErrorMessage = "general.error_message"
)

Variables

This section is empty.

Functions

func ContextWithParentSpan

func ContextWithParentSpan(parent context.Context, span trace.Span) context.Context

func CopyFromParentSpanAttribute

func CopyFromParentSpanAttribute(
	ctx context.Context,
	span trace.Span,
	attributeName string,
	parentAttributeName string,
)

func CopyFromParentSpanAttributeIfNotSet

func CopyFromParentSpanAttributeIfNotSet(
	ctx context.Context,
	span trace.Span,
	attributeName string,
	attributeValue string,
	parentAttributeName string,
)

func GetParentSpanAttribute

func GetParentSpanAttribute(ctx context.Context, parentAttributeName string) attribute.KeyValue

func GetParentSpanContext

func GetParentSpanContext(span trace.Span) trace.SpanContext

func GetSpanAttribute

func GetSpanAttribute(span trace.Span, attributeName string) attribute.KeyValue

func GetSpanAttributeFromCurrentContext

func GetSpanAttributeFromCurrentContext(ctx context.Context, attributeName string) attribute.KeyValue

func MapsToAttributes

func MapsToAttributes(maps map[string]interface{}) []attribute.KeyValue

func MetadataToSet

func MetadataToSet(meta metadata.Metadata) attribute.Set

func ParentSpanFromContext

func ParentSpanFromContext(ctx context.Context) trace.Span

func TraceErrFromContext

func TraceErrFromContext(ctx context.Context, err error) error

func TraceErrFromSpan

func TraceErrFromSpan(span trace.Span, err error) error

Types

type AppTracer

type AppTracer interface {
	trace.Tracer
}

func NewAppTracer

func NewAppTracer(name string, options ...trace.TracerOption) AppTracer

type TracingOpenTelemetry

type TracingOpenTelemetry struct {
	TracerProvider *tracesdk.TracerProvider
	AppTracer      AppTracer
	// contains filtered or unexported fields
}

func NewOtelTracing

func NewOtelTracing(
	config *config2.OpenTelemetryOptions,
	environment environemnt.Environment,
) (*TracingOpenTelemetry, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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