apmredigo

package module
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package apmredigo provides helpers for tracing github.com/gomodule/redigo/redis client operations as spans.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, conn redis.Conn, commandName string, args ...interface{}) (interface{}, error)

Do calls conn.Do(commandName, args...), and also reports the operation as a span to Elastic APM.

func DoWithTimeout

func DoWithTimeout(ctx context.Context, conn redis.Conn, timeout time.Duration, commandName string, args ...interface{}) (interface{}, error)

DoWithTimeout calls redis.DoWithTimeout(conn, timeout, commandName, args...), and also reports the operation as a span to Elastic APM.

Types

type Conn

type Conn interface {
	redis.Conn

	// WithContext returns a shallow copy of the connection with
	// its context changed to ctx.
	//
	// To report commands as spans, ctx must contain a transaction or span.
	WithContext(ctx context.Context) Conn
}

Conn is the interface returned by ContextConn.

Conn's Do method reports spans using the bound context.

func Wrap

func Wrap(conn redis.Conn) Conn

Wrap wraps conn such that its Do method calls apmredigo.Do with context.Background(). The context can be changed using Conn.WithContext.

If conn implements redis.ConnWithTimeout, then the DoWithTimeout method will similarly call apmredigo.DoWithTimeout.

Send and Receive calls are not currently captured.

Jump to

Keyboard shortcuts

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