Documentation ¶
Index ¶
- Constants
- func ContextToHTTP(ctx context.Context, req *http.Request)
- func HTTPToContext(ctx context.Context, req *http.Request, tracer opentracing.Tracer, ...) context.Context
- func InitGlobalTracer(serviceName, endpoint string, sampleRate float64) (io.Closer, error)
- type GeneralSpan
- type MongoSpan
- type Option
- type RedisSpan
Constants ¶
const (
DefaultSampleRate = 0.01
)
DefaultSampleRate is the default sample rate
Variables ¶
This section is empty.
Functions ¶
func ContextToHTTP ¶
ContextToHTTP propagate tracing info into HTTP header, useful in server side.
Types ¶
type GeneralSpan ¶
type GeneralSpan struct { }
GeneralSpan for non db tracing, useful in boot up goroutine. default is ChildOfRef reference type
func (GeneralSpan) FinishSpan ¶
func (GeneralSpan) FinishSpan(span opentracing.Span, err error)
FinishSpan finish a span
type MongoSpan ¶
type MongoSpan struct{}
MongoSpan for span operation in mongo
func (MongoSpan) FinishSpan ¶
FinishSpan finish a span after mongo operation
type Option ¶
type Option func(span *options)
Option for GeneralSpan option
func WithChildOfSpan ¶
func WithChildOfSpan() Option
WithChildOfSpan set ChildOfRef reference type to the span NOTE: the difference of ChildOfRef type and FollowsFromRef type is logically at present, same behavior in frontend presention
func WithFollowsFromSpan ¶
func WithFollowsFromSpan() Option
WithFollowsFromSpan set FollowsFromRef reference type to the span Example usage : sp := tracing.General().StartSpan(ctx, tracing.WithFollowsFromSpan())
type RedisSpan ¶
type RedisSpan struct{}
RedisSpan for span operation in redis
func (RedisSpan) FinishSpan ¶
FinishSpan finish a span after redis operation