Documentation ¶
Overview ¶
Package middleware provides some usable transport middleware to deal with propagating Zipkin traces across service boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
HandlerFunc is a middleware function for incoming HTTP requests.
func FromHTTPRequest ¶
func FromHTTPRequest(tracer opentracing.Tracer, operationName string, ) HandlerFunc
FromHTTPRequest returns a Middleware HandlerFunc that tries to join with an OpenTracing trace found in the HTTP request headers and starts a new Span called `operationName`. If no trace could be found in the HTTP request headers, the Span will be a trace root. The Span is incorporated in the HTTP Context object and can be retrieved with opentracing.SpanFromContext(ctx).
type RequestFunc ¶
RequestFunc is a middleware function for outgoing HTTP requests.
func ToHTTPRequest ¶
func ToHTTPRequest(tracer opentracing.Tracer) RequestFunc
ToHTTPRequest returns a RequestFunc that injects an OpenTracing Span found in context into the HTTP Headers. If no such Span can be found, the RequestFunc is a noop.