trace

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KafkaConsumerComponent definition.
	KafkaConsumerComponent = "kafka-consumer"
	// KafkaAsyncProducerComponent definition.
	KafkaAsyncProducerComponent = "kafka-async-producer"
	// AMQPConsumerComponent definition.
	AMQPConsumerComponent = "amqp-consumer"
	// AMQPPublisherComponent definition.
	AMQPPublisherComponent = "amqp-publisher"
	// HTTPComponent definition.
	HTTPComponent = "http"
	// HTTPClientComponent definition.
	HTTPClientComponent = "http-client"
)

Variables

This section is empty.

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 compoent.

func ConsumerSpan added in v0.4.6

func ConsumerSpan(
	ctx context.Context,
	opName, cmp string,
	hdr map[string]string,
	tags ...opentracing.Tag,
) (opentracing.Span, context.Context)

ConsumerSpan starts a new consumer span.

func FinishHTTPSpan

func FinishHTTPSpan(sp opentracing.Span, code int)

FinishHTTPSpan finishes a HTTP span by providing a HTTP status code.

func HTTPOpName added in v0.4.0

func HTTPOpName(cmp, method, path string) string

HTTPOpName return a string representation of the HTTP request operation.

func HTTPSpan added in v0.4.6

func HTTPSpan(path string, r *http.Request) (opentracing.Span, *http.Request)

HTTPSpan starts a new HTTP span.

func SQLSpan added in v0.4.6

func SQLSpan(
	ctx context.Context,
	opName, cmp, sqlType, instance, user, stmt string,
	tags ...opentracing.Tag,
) (opentracing.Span, context.Context)

SQLSpan starts a new SQL child span with specified tags.

func Setup

func Setup(name, ver, agentAddress, samplerType string, samplerParam float64) error

Setup tracing by providing all necessary parameters.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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