Documentation ¶
Index ¶
- Variables
- func GetDuration(ctx context.Context) time.Duration
- func GetDurationMilliseconds(ctx context.Context) float64
- func GetStartTime(ctx context.Context) time.Time
- func LogHook(config *eredis_config.Config) redis.Hook
- func MetricHook(config *eredis_config.Config) redis.Hook
- func StartTimeHook() redis.Hook
- type RedisHook
- func (i *RedisHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (i *RedisHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (i *RedisHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)
- func (i *RedisHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
- func (i *RedisHook) SetAfterProcess(p func(ctx context.Context, cmd redis.Cmder) error) *RedisHook
- func (i *RedisHook) SetAfterProcessPipeline(p func(ctx context.Context, cmds []redis.Cmder) error) *RedisHook
- func (i *RedisHook) SetBeforeProcess(p func(ctx context.Context, cmd redis.Cmder) (context.Context, error)) *RedisHook
- func (i *RedisHook) SetBeforeProcessPipeline(p func(ctx context.Context, cmds []redis.Cmder) (context.Context, error)) *RedisHook
- type TraceOption
- type TracingHook
- func (th *TracingHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error
- func (th *TracingHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (th *TracingHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)
- func (th *TracingHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ClientHandleCounter ... RedisHandleCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Namespace: "", Name: "redis_handle_total", }, []string{"name", "method", "addr", "result"}) // ClientHandleHistogram ... RedisHandleHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "", Name: "redis_handle_seconds", }, []string{"name", "method", "addr"}) )
Functions ¶
func GetDurationMilliseconds ¶
func LogHook ¶
func LogHook(config *eredis_config.Config) redis.Hook
func MetricHook ¶
func MetricHook(config *eredis_config.Config) redis.Hook
Types ¶
type RedisHook ¶
type RedisHook struct { redis.Hook // contains filtered or unexported fields }
func NewRedisHook ¶
func NewRedisHook() *RedisHook
func (*RedisHook) AfterProcess ¶
func (*RedisHook) AfterProcessPipeline ¶
func (*RedisHook) BeforeProcess ¶
func (*RedisHook) BeforeProcessPipeline ¶
func (*RedisHook) SetAfterProcess ¶
func (*RedisHook) SetAfterProcessPipeline ¶
func (*RedisHook) SetBeforeProcess ¶
type TraceOption ¶
type TraceOption interface {
// contains filtered or unexported methods
}
TraceOption specifies instrumentation configuration options.
func WithAttributes ¶
func WithAttributes(attrs ...attribute.KeyValue) TraceOption
WithAttributes specifies additional attributes to be added to the span.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) TraceOption
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.
type TracingHook ¶
type TracingHook struct {
// contains filtered or unexported fields
}
func NewTracingHook ¶
func NewTracingHook(opts ...TraceOption) *TracingHook
func (*TracingHook) AfterProcess ¶
func (th *TracingHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error
func (*TracingHook) AfterProcessPipeline ¶
func (th *TracingHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
func (*TracingHook) BeforeProcess ¶
func (*TracingHook) BeforeProcessPipeline ¶
Click to show internal directories.
Click to hide internal directories.