zipkines

package module
v0.0.0-...-adeedfc Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 11 Imported by: 0

README

Zipkin instrumentation for go-elasticsearch

This library provides instrumentation for go-elasticsearch library

Getting started

go get github.com/jcchavezs/zipkin-instrumentation-go-elasticsearch

Example

func main() {
	cfg := elasticsearch.Config{
		Transport: eszipkin.NewTransport()
	}

	es, _ := elasticsearch.NewClient(cfg)
	log.Println(elasticsearch.Version)
	log.Println(es.Info())
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTransport

func NewTransport(tracer *zipkin.Tracer, opts ...TraceOpt) http.RoundTripper

NewTransport returns a transport instance including tracing for ES calls

Types

type TraceOpt

type TraceOpt func(r *transport)

func RoundTripper

func RoundTripper(rt http.RoundTripper) TraceOpt

RoundTripper allows to inject a `http.RoundTripper` to be wrapped but it should never be used with a traced transport, otherwise traces will be duplicated.

func WithLogger

func WithLogger(l *log.Logger) TraceOpt

WithLogger allows to pass a `log.Logger` into the transport

func WithTagQuery

func WithTagQuery() TraceOpt

WithTagQuery tags the query sent to ES in non GET requests.

func WithTagTotalHits

func WithTagTotalHits() TraceOpt

WithTagTotalHits tags the total hits in a successful query response.

func WithTagTotalShards

func WithTagTotalShards() TraceOpt

WithTagTotalShards tags the total shards being queried in a successful query response.

func WithWhitelistQueryParams

func WithWhitelistQueryParams(l ...string) TraceOpt

WithWhitelistQueryParams allows to pass the whitelist of query parameters that should be recorded in a ES query, e.g. "_routing"

type TraceOpts

type TraceOpts struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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