tracing

package
v0.0.0-...-9b0d78d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpToB3Map

func DumpToB3Map(traceCtx *TraceContext) map[string]string

func WithB3FromMap

func WithB3FromMap(ctx context.Context, b3Map map[string]string) context.Context

func WithB3FromMessage

func WithB3FromMessage(ctx context.Context, msg *sarama.ConsumerMessage) context.Context

Types

type TraceContext

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

TraceContext provides wrapper functions for tracing flows using the opentelemetry standard.

func NewTraceContext

func NewTraceContext(ctx context.Context, service string, detailed bool) *TraceContext

NewTraceContext creates a new trace for the given service. In addition, detailed tracing can be enabled.

func (*TraceContext) Context

func (c *TraceContext) Context() context.Context

Context returns the context used by the tracer.

func (*TraceContext) CurrentSpan

func (c *TraceContext) CurrentSpan() trace.Span

CurrentSpan returns the most recent span that is still recording (hasn't ended).

func (*TraceContext) EndCurrentDetailedSpan

func (c *TraceContext) EndCurrentDetailedSpan()

EndCurrentDetailedSpan ends the most recent span ONLY if detailed tracing is enabled that is still recording (hasn't ended).

func (*TraceContext) EndCurrentSpan

func (c *TraceContext) EndCurrentSpan()

EndCurrentSpan ends the most recent span that is still recording (hasn't ended).

func (*TraceContext) GetSpanN

func (c *TraceContext) GetSpanN(n int) trace.Span

GetSpanN retrieves the span with the index of n.

func (*TraceContext) LastSpan

func (c *TraceContext) LastSpan() trace.Span

LastSpan returns the last span regardless of its recording status or nil if there is none.

func (*TraceContext) RootSpan

func (c *TraceContext) RootSpan() trace.Span

RootSpan returns the root span of the current TraceContext.

func (*TraceContext) SetAttribute

func (c *TraceContext) SetAttribute(key string, value string)

SetAttribute sets the value of the given key.

func (*TraceContext) StartDetailedSpan

func (c *TraceContext) StartDetailedSpan(name string)

StartDetailedSpan starts a span that will only be started if detailed tracing is enabled.

func (*TraceContext) StartSpan

func (c *TraceContext) StartSpan(name string)

StartSpan starts a new span.

Jump to

Keyboard shortcuts

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