Documentation
¶
Index ¶
- Variables
- type Option
- type OptionTagTraceIDs
- type SpanImpl
- func (span *SpanImpl) Annotate(ts time.Time, event string)
- func (span *SpanImpl) Fields() field.AbstractFields
- func (span *SpanImpl) Finish()
- func (span *SpanImpl) FinishWithDuration(duration time.Duration)
- func (*SpanImpl) Flush()
- func (span *SpanImpl) ID() any
- func (span *SpanImpl) Name() string
- func (span *SpanImpl) Parent() tracer.Span
- func (span *SpanImpl) SendAsIs()
- func (span *SpanImpl) SetField(k field.Key, v field.Value)
- func (span *SpanImpl) SetFields(fields field.AbstractFields)
- func (span *SpanImpl) SetName(name string)
- func (span *SpanImpl) StartTS() time.Time
- func (span *SpanImpl) TraceIDs() belt.TraceIDs
- type TracerImpl
- func (t *TracerImpl) Flush()
- func (t *TracerImpl) Start(name string, parent tracer.Span, options ...tracer.SpanOption) tracer.Span
- func (t *TracerImpl) StartChildWithBelt(belt *belt.Belt, name string, options ...tracer.SpanOption) (tracer.Span, *belt.Belt)
- func (t *TracerImpl) StartChildWithCtx(ctx context.Context, name string, options ...tracer.SpanOption) (tracer.Span, context.Context)
- func (t *TracerImpl) StartWithBelt(belt *belt.Belt, name string, options ...tracer.SpanOption) (tracer.Span, *belt.Belt)
- func (t *TracerImpl) StartWithCtx(ctx context.Context, name string, options ...tracer.SpanOption) (tracer.Span, context.Context)
- func (t *TracerImpl) WithContextFields(allFields *field.FieldsChain, newFieldsCount int) belt.Tool
- func (t *TracerImpl) WithHooks(hooks ...tracer.Hook) tracer.Tracer
- func (t *TracerImpl) WithPreHooks(hooks ...tracer.Hook) tracer.Tracer
- func (t *TracerImpl) WithTraceIDs(traceIDs belt.TraceIDs, newTraceIDsCount int) belt.Tool
Constants ¶
This section is empty.
Variables ¶
var Default = func() tracer.Tracer { reporter := logreporter.NewReporter(log.Default()) defer reporter.Close() tracer, err := zipkin.NewTracer(reporter) if err != nil { log.Fatalf("unable to create a zipkin tracer: %v", err) } return New(tracer) }
Default returns the default tracer.Tracer on top of zipkin.
var DefaultTagTraceIDs = `trace_ids`
DefaultTagTraceIDs is the tag name used to store belt.TraceIDs value.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an abstract option (applicable only to the Tracer implementation provided by this package).
type OptionTagTraceIDs ¶
type OptionTagTraceIDs string
OptionTagTraceIDs is the option which redefines the tag name for the TraceIDs value.
type SpanImpl ¶
type SpanImpl struct {
// contains filtered or unexported fields
}
SpanImpl is the implementation of tracer.Span on top of zipkin.Span.
func (*SpanImpl) Fields ¶
func (span *SpanImpl) Fields() field.AbstractFields
Fields implements tracer.Span.
func (*SpanImpl) FinishWithDuration ¶
FinishWithDuration implements tracer.Span.
func (*SpanImpl) SetFields ¶
func (span *SpanImpl) SetFields(fields field.AbstractFields)
SetFields implements tracer.Span.
type TracerImpl ¶
type TracerImpl struct { ZipkinTracer *zipkin.Tracer ContextFields *field.FieldsChain TraceIDs belt.TraceIDs TagTraceIDs string Hooks tracer.Hooks PreHooks tracer.Hooks // contains filtered or unexported fields }
TracerImpl is the implementation of tracer.Tracer on top of zipkin.Tracer.
func New ¶
func New(zipkinTracer *zipkin.Tracer, options ...Option) *TracerImpl
New returns a new instance of TracerImpl.
func (*TracerImpl) Start ¶
func (t *TracerImpl) Start(name string, parent tracer.Span, options ...tracer.SpanOption) tracer.Span
Start implements tracer.Tracer.
func (*TracerImpl) StartChildWithBelt ¶
func (t *TracerImpl) StartChildWithBelt(belt *belt.Belt, name string, options ...tracer.SpanOption) (tracer.Span, *belt.Belt)
StartChildWithBelt implements tracer.Tracer.
func (*TracerImpl) StartChildWithCtx ¶
func (t *TracerImpl) StartChildWithCtx(ctx context.Context, name string, options ...tracer.SpanOption) (tracer.Span, context.Context)
StartChildWithCtx implements tracer.Tracer.
func (*TracerImpl) StartWithBelt ¶
func (t *TracerImpl) StartWithBelt(belt *belt.Belt, name string, options ...tracer.SpanOption) (tracer.Span, *belt.Belt)
StartWithBelt implements tracer.Tracer.
func (*TracerImpl) StartWithCtx ¶
func (t *TracerImpl) StartWithCtx(ctx context.Context, name string, options ...tracer.SpanOption) (tracer.Span, context.Context)
StartWithCtx implements tracer.Tracer.
func (*TracerImpl) WithContextFields ¶
func (t *TracerImpl) WithContextFields(allFields *field.FieldsChain, newFieldsCount int) belt.Tool
WithContextFields implements tracer.Tracer.
func (*TracerImpl) WithHooks ¶
func (t *TracerImpl) WithHooks(hooks ...tracer.Hook) tracer.Tracer
WithHooks implements tracer.Tracer.
func (*TracerImpl) WithPreHooks ¶
func (t *TracerImpl) WithPreHooks(hooks ...tracer.Hook) tracer.Tracer
WithPreHooks implements tracer.Tracer.
func (*TracerImpl) WithTraceIDs ¶
func (t *TracerImpl) WithTraceIDs(traceIDs belt.TraceIDs, newTraceIDsCount int) belt.Tool
WithTraceIDs implements tracer.Tracer.