tracing

package
v0.0.0-...-16b6e5b Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(carrier *KafkaHeadersCarrier) (opentracing.SpanContext, error)

Extract extracts the span context out of Kafka headers.

func InitProductionZipkin

func InitProductionZipkin(serviceName, zipkinHost string, zipkinPort int) (reporter.Reporter, error)

func InitSampleZipkin

func InitSampleZipkin(serviceName, zipkinHost string, zipkinPort int) (reporter.Reporter, error)

func InitTestingZipkin

func InitTestingZipkin(serviceName, zipkinHost string, zipkinPort int) (reporter.Reporter, error)

func InitTracer

func InitTracer() (io.Closer, error)

Use Zap logger to print out spans. Use a Prometheus registerer to expose metrics.

func Inject

func Inject(span opentracing.Span, carrier *KafkaHeadersCarrier) error

Inject injects the span context into Kafka headers.

func SampleManualInitTracer

func SampleManualInitTracer(serviceName string) (io.Closer, error)

Sample configuration for testing. Use constant sampling to sample every trace and enable LogSpan to log every span via configured Logger. Use a Prometheus registerer to expose metrics.

Types

type KafkaHeadersCarrier

type KafkaHeadersCarrier []kafka.Header

KafkaHeadersCarrier satisfies both TextMapWriter and TextMapReader. See Inject(..) method as example usage on producer side. See Extract(..) method as example usage on consumer side.

func (*KafkaHeadersCarrier) ForeachKey

func (c *KafkaHeadersCarrier) ForeachKey(handler func(key, val string) error) error

ForeachKey implements ForeachKey(..) of opentracing.TextMapReader interface.

func (*KafkaHeadersCarrier) Set

func (c *KafkaHeadersCarrier) Set(key, val string)

Set implements Set() of opentracing.TextMapWriter interface.

Jump to

Keyboard shortcuts

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