trace

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package trace provides trace support and helper methods.

Index

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 Close

func Close() error

Close the tracer.

func ComponentOpName added in v0.5.0

func ComponentOpName(cmp, target string) string

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 Setup

func Setup(name, ver, agent, typ string, prm float64) error

Setup tracing by providing all necessary parameters.

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.

Jump to

Keyboard shortcuts

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