apmgoredis

package module
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

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.

Jump to

Keyboard shortcuts

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