zipkin

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package zipkin provides various Transports that can be used with RemoteReporter for submitting traces to Zipkin backend.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPTransport

func NewHTTPTransport(url string, options ...HTTPOption) (transport.Transport, error)

NewHTTPTransport returns a new HTTP-backend transport. url should be an http url to handle post request, typically something like:

http://hostname:9411/api/v1/spans
Example
// assume this is your main()

transport, err := zipkin.NewHTTPTransport(
	"http://localhost:9411/api/v1/spans",
	zipkin.HTTPBatchSize(10),
	zipkin.HTTPLogger(jaeger.StdLogger),
)
if err != nil {
	log.Fatalf("Cannot initialize Zipkin HTTP transport: %v", err)
}
tracer, closer := jaeger.NewTracer(
	"my-service-name",
	jaeger.NewConstSampler(true),
	jaeger.NewRemoteReporter(transport, nil),
)
defer closer.Close()
opentracing.InitGlobalTracer(tracer)

// initialize servers
Output:

Types

type HTTPOption

type HTTPOption func(c *HTTPTransport)

HTTPOption sets a parameter for the HttpCollector

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 spans.

func HTTPLogger

func HTTPLogger(logger jaeger.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 HTTPTimeout

func HTTPTimeout(duration time.Duration) HTTPOption

HTTPTimeout sets maximum timeout for http request.

type HTTPTransport

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

HTTPTransport implements Transport by forwarding spans to a http server.

func (*HTTPTransport) Append

func (c *HTTPTransport) Append(s *zipkincore.Span) (int, error)

Append implements Transport.

func (*HTTPTransport) Close

func (c *HTTPTransport) Close() error

Close implements Transport.

func (*HTTPTransport) Flush

func (c *HTTPTransport) Flush() (int, error)

Flush implements Transport.

Jump to

Keyboard shortcuts

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