Documentation
¶
Index ¶
- func DumpToB3Map(traceCtx *TraceContext) map[string]string
- func WithB3FromMap(ctx context.Context, b3Map map[string]string) context.Context
- func WithB3FromMessage(ctx context.Context, msg *sarama.ConsumerMessage) context.Context
- type TraceContext
- func (c *TraceContext) Context() context.Context
- func (c *TraceContext) CurrentSpan() trace.Span
- func (c *TraceContext) EndCurrentDetailedSpan()
- func (c *TraceContext) EndCurrentSpan()
- func (c *TraceContext) GetSpanN(n int) trace.Span
- func (c *TraceContext) LastSpan() trace.Span
- func (c *TraceContext) RootSpan() trace.Span
- func (c *TraceContext) SetAttribute(key string, value string)
- func (c *TraceContext) StartDetailedSpan(name string)
- func (c *TraceContext) StartSpan(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpToB3Map ¶
func DumpToB3Map(traceCtx *TraceContext) map[string]string
func WithB3FromMap ¶
func WithB3FromMessage ¶
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.