Documentation ¶
Overview ¶
Package gomemcache provides tracing instrumentation for the memcached client (https://github.com/bradfitz/gomemcache).
The instrumentation works by wrapping the memcache client by calling `NewClientWithTracing` and tracing it's every operation.
Index ¶
- 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 ¶
This section is empty.
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 func(*config)
Option is used to configure the client.
func WithServiceName ¶
WithServiceName sets the service name.
func WithTraceProvider ¶
WithTracer configures the client with the provided trace provider.
Directories ¶
Path | Synopsis |
---|---|
memcache
|
|
otelmemcache
Module
|
|
otelmemcache/example
Module
|
|
otelmemcache/test
Module
|