trace

package
v0.10.1-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyTracingAnnotations

func CopyTracingAnnotations(src, dst map[string]string)

CopyTracingAnnotations copies the tracing data from the source annotations map to the destination annotations map.

func DeserializeSpanContext

func DeserializeSpanContext(ssc string) (sc opentrace.SpanContext, ok bool)

DeserializeSpanContext returns a SpanContext for given text representation.

func GetBackgroundContextWithSpan

func GetBackgroundContextWithSpan(ls *LogSpan) context.Context

GetBackgroundContextWithSpan get a background context with an existing span

func GetSpanContext

func GetSpanContext(annotations map[string]string) string

GetSpanContext returns the string representing the SpanContext kept in annotations.

func GetUpdateUUID

func GetUpdateUUID(annotations map[string]string) string

GetUpdateUUID returns the string representing the update UUID.

func InsertAnnotations

func InsertAnnotations(annotations map[string]string, span *LogSpan, uuid string) map[string]string

InsertAnnotations inserts serialized span context and update uuid to the annotations map.

func StringAttribute

func StringAttribute(key, value string) opentrace.Attribute

StringAttribute is equivalent to opentrace.StringAttribute.

Types

type LogSpan

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

LogSpan wraps a trace.Span type and adds logging when starting/ending span.

func GetSpan

func GetSpan(ctx context.Context) *LogSpan

GetSpan gets the current span from the context, if present.

func NewSpan

func NewSpan(ctx context.Context, args ...string) (context.Context, *LogSpan)

NewSpan creates a new Span and logs information about it.

func NewSpanWithRemoteParent

func NewSpanWithRemoteParent(ctx context.Context, parentSerialized string, args ...string) (context.Context, *LogSpan)

NewSpanWithRemoteParent starts a new child span of the span from the given parent.

func (*LogSpan) Annotate

func (s *LogSpan) Annotate(attributes []opentrace.Attribute, str string)

Annotate runs annotate function on internal span.

func (*LogSpan) End

func (s *LogSpan) End(err error)

End calls End() function on span and logs information about it. Sets status in case of error.

func (*LogSpan) EndSpan

func (s *LogSpan) EndSpan()

EndSpan calls End() function on span and logs information about it. Sets status in case of error.

func (*LogSpan) Log

func (s *LogSpan) Log(format string, a ...interface{})

Log creates a new Span and logs information about it.

func (*LogSpan) MarkAsEntitySpan

func (s *LogSpan) MarkAsEntitySpan(entityPath string, entity string)

MarkAsEntitySpan creates a new Span and logs information about it.

func (*LogSpan) SerializeSpanContext

func (s *LogSpan) SerializeSpanContext() string

SerializeSpanContext returns a string which is a text representation of the SpanContext

func (*LogSpan) SetError

func (s *LogSpan) SetError(err error) error

SetError sets err attribute and returns given argument.

Jump to

Keyboard shortcuts

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