valkey

package
v1.72.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package valkey provides tracing functions for tracing the valkey-io/valkey-go package (https://github.com/valkey-io/valkey-go).

Example

To start tracing Valkey, simply create a new client using the library and continue using as you normally would.

tracer.Start()
defer tracer.Stop()

vk, err := valkeytrace.NewClient(valkey.ClientOption{
	InitAddress: []string{"localhost:6379"},
})
if err != nil {
	log.Fatal(err)
	return
}

if err := vk.Do(context.Background(), vk.B().Set().Key("key").Value("value").Build()).Error(); err != nil {
	log.Fatal(err)
	return
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(clientOption valkey.ClientOption, opts ...Option) (valkey.Client, error)

NewClient returns a new valkey.Client enhanced with tracing.

Types

type Option

type Option func(*config)

Option represents an option that can be used to create or wrap a client.

func WithRawCommand

func WithRawCommand(rawCommand bool) Option

WithRawCommand can be used to set a tag `valkey.raw_command` in the created spans (disabled by default). Warning: please note the datadog-agent currently does not support obfuscation for this tag, so use this at your own risk.

func WithServiceName

func WithServiceName(name string) Option

WithServiceName sets the given service name for the client.

Jump to

Keyboard shortcuts

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