Documentation ¶
Overview ¶
Package redis provides tracing functions for tracing the go-redis/redis package (https://github.com/go-redis/redis). This package supports go-redis/redis v7.
Index ¶
- func NewClient(opt *redis.Options, opts ...ClientOption) *redis.Client
- func WrapClient(c *redis.Client, opts ...ClientOption) *redis.Client
- type ClientOption
- func WithAnalytics(on bool) ClientOption
- func WithAnalyticsRate(rate float64) ClientOption
- func WithDB(db string) ClientOption
- func WithHost(host string) ClientOption
- func WithPort(port string) ClientOption
- func WithRedisOptions(opts *redis.Options) ClientOption
- func WithServiceName(name string) ClientOption
- type Hook
- func (h *Hook) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (h *Hook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (h *Hook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)
- func (h *Hook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(opt *redis.Options, opts ...ClientOption) *redis.Client
NewClient returns a new Client that is traced with the default tracer under the service name "redis".
func WrapClient ¶
func WrapClient(c *redis.Client, opts ...ClientOption) *redis.Client
WrapClient wraps a given redis.Client with a tracer under the given service name.
Types ¶
type ClientOption ¶
type ClientOption func(*clientConfig)
ClientOption represents an option that can be used to create or wrap a client.
func WithAnalytics ¶
func WithAnalytics(on bool) ClientOption
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
func WithAnalyticsRate(rate float64) ClientOption
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithRedisOptions ¶
func WithRedisOptions(opts *redis.Options) ClientOption
WithRedisOptions sets the redis.Option for the client.
func WithServiceName ¶
func WithServiceName(name string) ClientOption
WithServiceName sets the given service name for the client.
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook imprements redis.Hook.