zipkin

package
v0.0.0-...-50a42c1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPCollector

func NewHTTPCollector(url string, options ...HTTPOption) (zipkin.Collector, error)

NewHTTPCollector returns a new HTTP-backend Collector. url should be a http url for handle post request. timeout is passed to http client. queueSize control the maximum size of buffer of async queue. The logger is used to log errors, such as send failures;

Types

type Client

type Client interface {
	Do(r *http.Request) (*http.Response, error)
}

type HTTPCollector

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

HTTPCollector implements Collector by forwarding spans to a http server.

func (*HTTPCollector) Close

func (c *HTTPCollector) Close() error

Close implements Collector.

func (*HTTPCollector) Collect

func (c *HTTPCollector) Collect(s *zipkincore.Span) error

Collect implements Collector.

type HTTPOption

type HTTPOption func(c *HTTPCollector)

HTTPOption sets a parameter for the HttpCollector

func HTTPBatchInterval

func HTTPBatchInterval(d time.Duration) HTTPOption

HTTPBatchInterval sets the maximum duration we will buffer traces before emitting them to the collector. The default batch interval is 1 second.

func HTTPBatchSize

func HTTPBatchSize(n int) HTTPOption

HTTPBatchSize sets the maximum batch size, after which a collect will be triggered. The default batch size is 100 traces.

func HTTPClient

func HTTPClient(client Client) HTTPOption

HTTPClient sets a custom http client to use.

func HTTPLogger

func HTTPLogger(logger Logger) HTTPOption

HTTPLogger sets the logger used to report errors in the collection process. By default, a no-op logger is used, i.e. no errors are logged anywhere. It's important to set this option in a production service.

func HTTPMaxBacklog

func HTTPMaxBacklog(n int) HTTPOption

HTTPMaxBacklog sets the maximum backlog size, when batch size reaches this threshold, spans from the beginning of the batch will be disposed

type Logger

type Logger interface {
	Log(keyvals ...interface{}) error
}

func NewNopLogger

func NewNopLogger() Logger

NewNopLogger provides a Logger that discards all Log data sent to it.

type TraceClient

type TraceClient struct {
	*hystrix.HTTPClient
}

func NewClient

func NewClient(commandName string) *TraceClient

func (*TraceClient) Do

func (c *TraceClient) Do(r *http.Request) (*http.Response, error)

func (*TraceClient) Get

func (c *TraceClient) Get(url string) (*http.Response, error)

func (*TraceClient) Head

func (c *TraceClient) Head(url string) (*http.Response, error)

func (*TraceClient) Post

func (c *TraceClient) Post(url string, contentType string, body io.Reader) (*http.Response, error)

func (*TraceClient) PostForm

func (c *TraceClient) PostForm(url string, data url.Values) (*http.Response, error)

Jump to

Keyboard shortcuts

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