Documentation ¶
Overview ¶
Package otelmemcache instruments github.com/bradfitz/gomemcache/memcache.
This instrumentation provided is tracing instrumentation for the memcached client.
The instrumentation works by wrapping the memcached client by calling `NewClientWithTracing` and tracing it's every operation.
Index ¶
- func SemVersion() string
- func Version() string
- type Client
- func (c *Client) Add(item *memcache.Item) error
- func (c *Client) CompareAndSwap(item *memcache.Item) error
- func (c *Client) Decrement(key string, delta uint64) (uint64, error)
- func (c *Client) Delete(key string) error
- func (c *Client) DeleteAll() error
- func (c *Client) FlushAll() error
- func (c *Client) Get(key string) (*memcache.Item, error)
- func (c *Client) GetMulti(keys []string) (map[string]*memcache.Item, error)
- func (c *Client) Increment(key string, delta uint64) (uint64, error)
- func (c *Client) Ping() error
- func (c *Client) Replace(item *memcache.Item) error
- func (c *Client) Set(item *memcache.Item) error
- func (c *Client) Touch(key string, seconds int32) error
- func (c *Client) WithContext(ctx context.Context) *Client
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SemVersion ¶ added in v0.24.0
func SemVersion() string
SemVersion is the semantic version to be supplied to tracer/meter creation.
Types ¶
type Client ¶
Client is a wrapper around *memcache.Client.
func NewClientWithTracing ¶
NewClientWithTracing wraps the provided memcache client to allow tracing of all client operations. Accepts options to set trace provider and service name, otherwise uses registered global trace provider and default value for service name.
Every client operation starts a span with appropriate attributes, executes the operation and ends the span (additionally also sets a status error code and message, if an error occurs). Optionally, client context can be set before an operation with the WithContext method.
func (*Client) CompareAndSwap ¶
CompareAndSwap invokes the compare-and-swap operation and traces it
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to configure the client.
func WithTracerProvider ¶
func WithTracerProvider(provider oteltrace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.