Documentation ¶
Overview ¶
Package apmelasticsearch provides support for tracing the HTTP transport layer of Elasticsearch clients.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapRoundTripper ¶
func WrapRoundTripper(r http.RoundTripper, o ...ClientOption) http.RoundTripper
WrapRoundTripper returns an http.RoundTripper wrapping r, reporting each request as a span to Elastic APM, if the request's context contains a sampled transaction.
If r is nil, then http.DefaultTransport is wrapped.
Example ¶
httpClient := &http.Client{ Transport: WrapRoundTripper(http.DefaultTransport), } _ = httpClient // client, err := elastic.NewClient(elastic.SetHttpClient(httpClient)) // ...
Output:
Types ¶
type ClientOption ¶
type ClientOption func(*roundTripper)
ClientOption sets options for tracing client requests.
Click to show internal directories.
Click to hide internal directories.