Documentation ¶
Index ¶
- type Decider
- type RedisHook
- func (r *RedisHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (r *RedisHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (r *RedisHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)
- func (r *RedisHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
- type TraceOption
- type TraceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisHook ¶
type RedisHook struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...TraceOption) *RedisHook
func (*RedisHook) AfterProcess ¶
func (*RedisHook) AfterProcessPipeline ¶
func (*RedisHook) BeforeProcess ¶
type TraceOption ¶
type TraceOption func(o *TraceOptions)
func WithAllowRoot ¶
func WithAllowRoot(b bool) TraceOption
WithAllowRoot if set to true, will allow ocsql to create root spans in absence of exisiting spans or even context. Default is to not trace ocsql calls if no existing parent span is found in context or when using methods not taking context.
func WithDecider ¶
func WithDecider(fn Decider) TraceOption
WithPing if set to true, will enable the creation of spans on Ping requests.
func WithDefaultAttributes ¶
func WithDefaultAttributes(attrs ...trace.Attribute) TraceOption
WithDefaultAttributes will be set to each span as default.
type TraceOptions ¶
type TraceOptions struct { // AllowRoot, if set to true, will allow hook to create root spans in // absence of existing spans or even context. // Default is to not trace hook calls if no existing parent span is found // in context or when using methods not taking context. AllowRoot bool // Enable decide which cmd should be traced // Default allow all cmd expect "ping" Enable Decider // DefaultAttributes will be set to each span as default. DefaultAttributes []trace.Attribute }
Click to show internal directories.
Click to hide internal directories.