Documentation ¶
Index ¶
- func NewHTTPCollector(url string, options ...HTTPOption) (zipkin.Collector, error)
- type Client
- type HTTPCollector
- type HTTPOption
- type Logger
- type TraceClient
- func (c *TraceClient) Do(r *http.Request) (*http.Response, error)
- func (c *TraceClient) Get(url string) (*http.Response, error)
- func (c *TraceClient) Head(url string) (*http.Response, error)
- func (c *TraceClient) Post(url string, contentType string, body io.Reader) (*http.Response, error)
- func (c *TraceClient) PostForm(url string, data url.Values) (*http.Response, error)
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 HTTPCollector ¶
type HTTPCollector struct {
// contains filtered or unexported fields
}
HTTPCollector implements Collector by forwarding spans to a http server.
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