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

package apmgoredis

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

Package apmgoredis provides helpers for tracing github.com/go-redis/redis client operations as spans.

Index

Package Files

client.go doc.go

type Client Uses

type Client interface {
    redis.UniversalClient

    // Client() returns the wrapped *redis.Client,
    // or nil if a non-normal client is wrapped
    RedisClient() *redis.Client

    // ClusterClient returns the wrapped *redis.ClusterClient,
    // or nil if a non-cluster client is wrapped.
    Cluster() *redis.ClusterClient

    // Ring returns the wrapped *redis.Ring,
    // or nil if a non-ring client is wrapped.
    RingClient() *redis.Ring

    // WithContext returns a shallow copy of the client with
    // its context changed to ctx and will add instrumentation
    // with client.WrapProcess and client.WrapProcessPipeline
    //
    // To report commands as spans, ctx must contain a transaction or span.
    WithContext(ctx context.Context) Client
}

Client is the interface returned by Wrap.

Client implements redis.UniversalClient

func Wrap Uses

func Wrap(client redis.UniversalClient) Client

Wrap wraps client such that executed commands are reported as spans to Elastic APM, using the client's associated context. A context-specific client may be obtained by using Client.WithContext.

Package apmgoredis imports 4 packages (graph). Updated 2020-05-19. Refresh now. Tools for package owners.