Package http contains several http middlewares which can be used for instrumenting calls with Zipkin.
Discard is a convenience function that returns a pointer to a boolean false. Use this for RequestSamplerFuncs when wanting the RequestSampler to override the sampling decision to no.
NewServerMiddleware returns a http.Handler middleware with Zipkin tracing.
NewTransport returns a new Zipkin instrumented http RoundTripper which can be used with a standard library http Client.
Sample is a convenience function that returns a pointer to a boolean true. Use this for RequestSamplerFuncs when wanting the RequestSampler to override the sampling decision to yes.
Client holds a Zipkin instrumented HTTP Client.
NewClient returns an HTTP Client adding Zipkin instrumentation around an embedded standard Go http.Client.
DoWithAppSpan wraps http.Client's Do with tracing using an application span.
ClientOption allows optional configuration of Client.
ClientTags adds default Tags to inject into client application spans.
ClientTrace allows one to enable Go's net/http/httptrace.
TransportOptions passes optional Transport configuration to the internal transport used by Client.
WithClient allows one to add a custom configured http.Client to use.
WithRemoteEndpoint will set the remote endpoint for all spans.
ErrHandler allows instrumentations to decide how to tag errors based on the response status code >399 and the error from the Transport.RoundTrip
ErrResponseReader allows instrumentations to read the error body and decide to obtain information to it and add it to the span i.e. tag the span with a more meaningful error code or with error details.
RequestSamplerFunc can be implemented for client and/or server side sampling decisions that can override the existing upstream sampling decision. If the implementation returns nil, the existing sampling decision stays as is.
type ServerOption func(*handler)
ServerOption allows Middleware to be optionally configured.
RequestSampler allows one to set the sampling decision based on the details found in the http.Request. If wanting to keep the existing sampling decision from upstream as is, this function should return nil.
ServerErrHandler allows to pass a custom error handler for the server response
ServerTags adds default Tags to inject into server spans.
SpanName sets the name of the spans the middleware creates. Use this if wrapping each endpoint with its own Middleware. If omitting the SpanName option, the middleware will use the http request method as span name.
TagResponseSize will instruct the middleware to Tag the http response size in the server side span.
type TransportOption func(*transport)
TransportOption allows one to configure optional transport configuration.
RoundTripper adds the Transport RoundTripper to wrap.
TransportErrHandler allows to pass a custom error handler for the round trip
TransportErrResponseReader allows to pass a custom ErrResponseReader
TransportLogger allows to plug a logger into the transport
TransportRemoteEndpoint will set the remote endpoint for all spans.
TransportRequestSampler allows one to set the sampling decision based on the details found in the http.Request. It has preference over the existing sampling decision contained in the context. The function returns a *bool, if returning nil, sampling decision is not being changed whereas returning something else than nil is being used as sampling decision.
TransportTags adds default Tags to inject into transport spans.
TransportTrace allows one to enable Go's net/http/httptrace.