redisotel

package module
v9.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

README

OpenTelemetry instrumentation for go-redis

Installation

go get github.com/APITeamLimited/redis/extra/redisotel/v9

Usage

Tracing is enabled by adding a hook:

import (
    "github.com/APITeamLimited/redis/v9"
    "github.com/APITeamLimited/redis/extra/redisotel/v9"
)

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

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

Option specifies instrumentation configuration options.

func WithAttributes

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

WithAttributes specifies additional attributes to be added to the span.

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 TracingHook

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

func NewTracingHook

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