utils

package
v0.0.0-...-4a59535 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 GrpcTraceErrFromSpan

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

GrpcTraceErrFromSpan setting span with status error with error message

func GrpcTraceErrFromSpanWithCode

func GrpcTraceErrFromSpanWithCode(span trace.Span, err error, code int) error

GrpcTraceErrFromSpanWithCode setting span with status error with error message

func HttpTraceStatusFromContext

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

HttpTraceStatusFromContext create an error span if we have an error and a successful span when error is nil

func HttpTraceStatusFromSpan

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

HttpTraceStatusFromSpan create an error span if we have an error and a successful span when error is nil

func HttpTraceStatusFromSpanWithCode

func HttpTraceStatusFromSpanWithCode(
	span trace.Span,
	err error,
	code int,
) error

HttpTraceStatusFromSpanWithCode create an error span with specific status code if we have an error and a successful span when error is nil with a specific status

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 TraceErrStatusFromContext

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

func TraceErrStatusFromSpan

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

func TraceStatusFromContext

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

func TraceStatusFromSpan

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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