redisotel

package module
v8.11.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2022 License: BSD-2-Clause Imports: 8 Imported by: 44

README

OpenTelemetry instrumentation for go-redis

Installation

go get github.com/go-redis/redis/extra/redisotel/v8

Usage

Tracing is enabled by adding a hook:

import (
    "github.com/go-redis/redis/v8"
    "github.com/go-redis/redis/extra/redisotel"
)

rdb := rdb.NewClient(&rdb.Options{...})

rdb.AddHook(redisotel.NewTracingHook())

See example and documentation for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v8.11.5

type Option interface {
	// contains filtered or unexported methods
}

Option specifies instrumentation configuration options.

func WithAttributes added in v8.11.5

func WithAttributes(attrs ...attribute.KeyValue) Option

WithAttributes specifies additional attributes to be added to the span.

func WithTracerProvider added in v8.11.5

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 TracingHook

type TracingHook struct {
	// contains filtered or unexported fields
}

func NewTracingHook added in v8.8.2

func NewTracingHook(opts ...Option) *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 (th *TracingHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error)

func (*TracingHook) BeforeProcessPipeline

func (th *TracingHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL