Documentation ¶
Overview ¶
Package redis provides tracing functions for tracing the go-redis/redis package (https://github.com/go-redis/redis). This package supports versions up to go-redis 6.15.
Example ¶
To start tracing Redis, simply create a new client using the library and continue using as you normally would.
Output:
Example (Pipeliner) ¶
You can also trace Redis Pipelines. Simply use as usual and the traces will be automatically picked up by the underlying implementation.
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v1.0.0
Client is used to trace requests to a redis server.
func NewClient ¶ added in v1.0.0
func NewClient(opt *redis.Options, opts ...ClientOption) *Client
NewClient returns a new Client that is traced with the default tracer under the service name "redis".
func WrapClient ¶ added in v1.0.0
func WrapClient(c *redis.Client, opts ...ClientOption) *Client
WrapClient wraps a given redis.Client with a tracer under the given service name.
type ClientOption ¶ added in v1.0.0
type ClientOption func(*clientConfig)
ClientOption represents an option that can be used to create or wrap a client.
func WithAnalytics ¶ added in v1.11.0
func WithAnalytics(on bool) ClientOption
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶ added in v1.11.0
func WithAnalyticsRate(rate float64) ClientOption
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithServiceName ¶ added in v1.0.0
func WithServiceName(name string) ClientOption
WithServiceName sets the given service name for the client.