apm-agent-go: github.com/elastic/apm-agent-go/module/apmredigo Index | Files

package apmredigo

import "github.com/elastic/apm-agent-go/module/apmredigo"

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


Package Files

conn.go doc.go

func Do Uses

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 Uses

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.

type Conn Uses

type Conn interface {

    // 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 Uses

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.

Package apmredigo imports 5 packages (graph). Updated 2020-05-21. Refresh now. Tools for package owners.