zipkin

package
v0.0.0-...-183aff7 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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) Annotate

func (span *SpanImpl) Annotate(ts time.Time, event string)

Annotate implements tracer.Span.

func (*SpanImpl) Fields

func (span *SpanImpl) Fields() field.AbstractFields

Fields implements tracer.Span.

func (*SpanImpl) Finish

func (span *SpanImpl) Finish()

Finish implements tracer.Span.

func (*SpanImpl) FinishWithDuration

func (span *SpanImpl) FinishWithDuration(duration time.Duration)

FinishWithDuration implements tracer.Span.

func (*SpanImpl) Flush

func (*SpanImpl) Flush()

Flush implements tracer.Span.

func (*SpanImpl) ID

func (span *SpanImpl) ID() any

ID implements tracer.Span.

func (*SpanImpl) Name

func (span *SpanImpl) Name() string

Name implements tracer.Span.

func (*SpanImpl) Parent

func (span *SpanImpl) Parent() tracer.Span

Parent implements tracer.Span.

func (*SpanImpl) SendAsIs

func (span *SpanImpl) SendAsIs()

SendAsIs implements tracer.Span.

func (*SpanImpl) SetField

func (span *SpanImpl) SetField(k field.Key, v field.Value)

SetField implements tracer.Span.

func (*SpanImpl) SetFields

func (span *SpanImpl) SetFields(fields field.AbstractFields)

SetFields implements tracer.Span.

func (*SpanImpl) SetName

func (span *SpanImpl) SetName(name string)

SetName implements tracer.Span.

func (*SpanImpl) StartTS

func (span *SpanImpl) StartTS() time.Time

StartTS implements tracer.Span.

func (*SpanImpl) TraceIDs

func (span *SpanImpl) TraceIDs() belt.TraceIDs

TraceIDs 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) Flush

func (t *TracerImpl) Flush()

Flush implements tracer.Tracer.

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.

Jump to

Keyboard shortcuts

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