Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { WrapProcess(fn func(oldProcess func(redis.Cmder) error) func(redis.Cmder) error) WrapProcessPipeline(fn func(oldProcess func([]redis.Cmder) error) func([]redis.Cmder) error) }
Client .
type Option ¶
type Option interface {
// Apply sets the Option value of a config.
Apply(*config)
}
Option is the interface that applies a configuration option.
func WithAttributes ¶
WithAttributes specifies attributes that will be set to each span.
func WithSpanNameFormatter ¶
func WithSpanNameFormatter(spanNameFormatter SpanNameFormatter) Option
WithSpanNameFormatter takes an interface that will be called on every operation and the returned string will become the span name.
func WithSpanOptions ¶
func WithSpanOptions(opts SpanOptions) Option
WithSpanOptions specifies configuration for span to decide whether to enable some features.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.
type SpanNameFormatter ¶
type SpanNameFormatter interface { Format(ctx context.Context, cmd redis.Cmder) string FormatBatch(ctx context.Context, cmds []redis.Cmder) string }
SpanNameFormatter is an interface that used to format span names.
type SpanOptions ¶
type SpanOptions struct { // Ping, if set to true, will enable the creation of spans on Ping requests. Ping bool // DisableStatement if set to true, will suppress db.statement in spans. DisableStatement bool // RecordError, if set, will be invoked with the current error, and if the func returns true // the record will be recorded on the current span. RecordError func(err error) bool // AllowRoot, if set to true, will create root spans in absence of existing spans or even context. AllowRoot bool }
SpanOptions holds configuration of tracing span to decide whether to enable some features. by default all options are set to false intentionally when creating a wrapped driver and provide the most sensible default with both performance and security in mind.