apm-agent-go: github.com/elastic/apm-agent-go/module/apmelasticsearch Index | Examples | Files

package apmelasticsearch

import "github.com/elastic/apm-agent-go/module/apmelasticsearch"

Package apmelasticsearch provides support for tracing the HTTP transport layer of Elasticsearch clients.



Package Files

client.go doc.go requestname.go

func WrapRoundTripper Uses

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.


httpClient := &http.Client{
    Transport: WrapRoundTripper(http.DefaultTransport),
_ = httpClient

// client, err := elastic.NewClient(elastic.SetHttpClient(httpClient))
// ...

type ClientOption Uses

type ClientOption func(*roundTripper)

ClientOption sets options for tracing client requests.

Package apmelasticsearch imports 12 packages (graph). Updated 2020-07-31. Refresh now. Tools for package owners.