apmelasticsearch

package module
Version: v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 6

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.

Directories

Path Synopsis
internal
integration Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL