Documentation ¶
Overview ¶
Package elastic provides functions to trace the gopkg.in/olivere/elastic.v{3,5} packages.
Example (V3) ¶
To trace elastic.v3 you create a TracedHTTPClient in the same way but all requests must use the DoC() call to pass the request context.
Output:
Example (V5) ¶
To start tracing elastic.v5 requests, create a new TracedHTTPClient that you will use when initializing the elastic.Client.
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶ added in v1.0.0
func NewHTTPClient(opts ...ClientOption) *http.Client
NewHTTPClient returns a new http.Client which traces requests under the given service name.
Types ¶
type ClientOption ¶ added in v1.0.0
type ClientOption func(*clientConfig)
ClientOption represents an option that can be used when creating a client.
func WithServiceName ¶ added in v1.0.0
func WithServiceName(name string) ClientOption
WithServiceName sets the given service name for the client.
func WithTransport ¶ added in v1.0.0
func WithTransport(t *http.Transport) ClientOption
WithTransport sets the given transport as an http.Transport for the client.