Documentation ¶
Overview ¶
Package trace provides trace support and helper methods.
Index ¶
- Constants
- Variables
- func ChildSpan(ctx context.Context, opName, cmp string, tags ...opentracing.Tag) (opentracing.Span, context.Context)
- func Close() error
- func ComponentOpName(cmp, target string) string
- func ConsumerSpan(ctx context.Context, opName, cmp, corID string, hdr map[string]string, ...) (opentracing.Span, context.Context)
- func Setup(name, ver, agent, typ string, prm float64) error
- func SpanComplete(sp opentracing.Span, err error)
- func SpanError(sp opentracing.Span)
- func SpanSuccess(sp opentracing.Span)
Constants ¶
View Source
const ( // HostsTag is used to tag the components's hosts. HostsTag = "hosts" // VersionTag is used to tag the components's version. VersionTag = "version" )
Variables ¶
View Source
var ( // Version will be used to tag all traced components. // It can be used to distinguish between dev, stage, and prod environments. Version = "dev" )
Functions ¶
func ChildSpan ¶ added in v0.4.6
func ChildSpan(ctx context.Context, opName, cmp string, tags ...opentracing.Tag) (opentracing.Span, context.Context)
ChildSpan starts a new child span with specified tags.
func ComponentOpName ¶ added in v0.5.0
ComponentOpName returns a operation name for a component.
func ConsumerSpan ¶ added in v0.4.6
func ConsumerSpan(ctx context.Context, opName, cmp, corID string, hdr map[string]string, tags ...opentracing.Tag) (opentracing.Span, context.Context)
ConsumerSpan starts a new consumer span.
func SpanComplete ¶ added in v0.31.0
func SpanComplete(sp opentracing.Span, err error)
SpanComplete finishes a span with or without a error indicator.
func SpanError ¶ added in v0.4.6
func SpanError(sp opentracing.Span)
SpanError finishes a span with a error indicator.
func SpanSuccess ¶ added in v0.4.6
func SpanSuccess(sp opentracing.Span)
SpanSuccess finishes a span with a success indicator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.