opentracing

package
v0.0.0-...-f59cc51 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagTraceId = "trace.traceid"
	TagSpanId  = "trace.spanid"
	TagSampled = "trace.sampled"
)

Variables

View Source
var (

	// NoopTags is a trivial, minimum overhead implementation of Tags for which all operations are no-ops.
	NoopTags = &noopTags{}
)

Functions

func OpentracingServerInterceptor

func OpentracingServerInterceptor(tracer opentracing.Tracer) grpc.UnaryServerInterceptor

OpentracingServerInterceptor rewrite server's interceptor with open tracing

func SetInContext

func SetInContext(ctx context.Context, tags Tags) context.Context

Types

type MDReaderWriter

type MDReaderWriter struct {
	metadata.MD
}

MDReaderWriter metadata Reader and Writer

type Tags

type Tags interface {
	// Set sets the given key in the metadata tags.
	Set(key string, value interface{}) Tags
	// Has checks if the given key exists.
	Has(key string) bool
	// Values returns a map of key to values.
	// Do not modify the underlying map, please use Set instead.
	Values() map[string]interface{}
}

Tags is the interface used for storing request tags between Context calls. The default implementation is *not* thread safe, and should be handled only in the context of the request.

func Extract

func Extract(ctx context.Context) Tags

Extracts returns a pre-existing Tags object in the Context. If the context wasn't set in a tag interceptor, a no-op Tag storage is returned that will *not* be propagated in context.

func NewTags

func NewTags() Tags

Jump to

Keyboard shortcuts

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