Documentation ¶
Index ¶
- Variables
- func DoHTTP(c echo.Context, r *http.Request, client *zipkinhttp.Client) (*http.Response, error)
- func StartChildSpan(c echo.Context, spanName string, tracer *zipkin.Tracer) (childSpan zipkin.Span)
- func TraceFunc(c echo.Context, spanName string, spanTags Tags, tracer *zipkin.Tracer) func()
- func TraceProxy(tracer *zipkin.Tracer) echo.MiddlewareFunc
- func TraceProxyWithConfig(config TraceProxyConfig) echo.MiddlewareFunc
- func TraceServer(tracer *zipkin.Tracer) echo.MiddlewareFunc
- func TraceServerWithConfig(config TraceServerConfig) echo.MiddlewareFunc
- type ResponseWriter
- type Tags
- type TraceProxyConfig
- type TraceServerConfig
Constants ¶
This section is empty.
Variables ¶
var ( //DefaultSpanTags default span tags DefaultSpanTags = func(c echo.Context) map[string]string { return make(map[string]string) } //DefaultTraceProxyConfig default config for Trace Proxy DefaultTraceProxyConfig = TraceProxyConfig{Skipper: middleware.DefaultSkipper, SpanTags: DefaultSpanTags} //DefaultTraceServerConfig default config for Trace Server DefaultTraceServerConfig = TraceServerConfig{Skipper: middleware.DefaultSkipper, SpanTags: DefaultSpanTags} )
Functions ¶
func StartChildSpan ¶
func StartChildSpan(c echo.Context, spanName string, tracer *zipkin.Tracer) (childSpan zipkin.Span)
StartChildSpan starts a new child span as child of parent span from context user must call defer childSpan.Finish()
func TraceFunc ¶
TraceFunc wraps function call with span so that we can trace time taken by func, eventContext only provided if we want to store trace headers
func TraceProxy ¶
func TraceProxy(tracer *zipkin.Tracer) echo.MiddlewareFunc
TraceProxy middleware that traces reverse proxy
func TraceProxyWithConfig ¶
func TraceProxyWithConfig(config TraceProxyConfig) echo.MiddlewareFunc
TraceProxyWithConfig middleware that traces reverse proxy
func TraceServer ¶
func TraceServer(tracer *zipkin.Tracer) echo.MiddlewareFunc
TraceServer middleware that traces server calls
func TraceServerWithConfig ¶
func TraceServerWithConfig(config TraceServerConfig) echo.MiddlewareFunc
TraceServerWithConfig middleware that traces server calls
Types ¶
type ResponseWriter ¶
type ResponseWriter interface { http.ResponseWriter http.Flusher // Status returns the status code of the response or 0 if the response has // not been written Status() int // Written returns whether or not the ResponseWriter has been written. Written() bool // Size returns the size of the response body. Size() int // Before allows for a function to be called before the ResponseWriter has been written to. This is // useful for setting headers or any other operations that must happen before a response has been written. Before(func(ResponseWriter)) }
ResponseWriter is a wrapper around http.ResponseWriter that provides extra information about the response. It is recommended that middleware handlers use this construct to wrap a response writer if the functionality calls for it.
func NewResponseWriter ¶
func NewResponseWriter(rw http.ResponseWriter) ResponseWriter
NewResponseWriter creates a ResponseWriter that wraps an http.ResponseWriter
type TraceProxyConfig ¶
type TraceProxyConfig struct { Skipper middleware.Skipper Tracer *zipkin.Tracer SpanTags Tags }
TraceProxyConfig config for TraceProxyWithConfig
type TraceServerConfig ¶
type TraceServerConfig struct { Skipper middleware.Skipper Tracer *zipkin.Tracer SpanTags Tags }
TraceServerConfig config for TraceServerWithConfig