import "github.com/improbable-eng/go-httpwares/tracing/debug"
http_debug
adds /debug/request debugging information for HTTP requests.
This adds /debug/request
information for client-side and server-side HTTP APIs.
This utilises the x/net/trace
handlers that allow you to trace old requests.
- github.com/improbable-eng/go-httpwares
- github.com/improbable-eng/go-httpwares/tags
- golang.org/x/net/trace
- func DefaultIsStatusCodeAnError(statusCode int) bool
- func Middleware(opts ...Option) httpwares.Middleware
- func Tripperware(opts ...Option) httpwares.Tripperware
- type FilterFunc
- type IsStatusCodeAnErrorFunc
- type Option
doc.go middleware.go options.go tripperware.go
func DefaultIsStatusCodeAnError(statusCode int) bool
DefaultIsStatusCodeAnError defines a function that says whether a given request is an error based on a code.
func Middleware(opts ...Option) httpwares.Middleware
Middleware returns a http.Handler middleware that writes inbound requests to /debug/request.
The data logged will be: request headers, request ctxtags, response headers and response length.
func Tripperware(opts ...Option) httpwares.Tripperware
Tripperware returns a piece of client-side Tripperware that puts requests on the /debug/requests
page.
The data logged will be: request headers, request ctxtags, response headers and response length.
type FilterFunc func(req *http.Request) bool
FilterFunc allows users to provide a function that filters out certain methods from being traced.
If it returns false, the given request will not be traced.
type IsStatusCodeAnErrorFunc func(statusCode int) bool
IsStatusCodeAnErrorFunc allows the customization of which requests are considered errors in the tracing system.
type Option func(*options)
func WithFilterFunc(f FilterFunc) Option
WithFilterFunc customizes the function used for deciding whether a given call is traced or not.
func WithIsStatusCodeAnError(f IsStatusCodeAnErrorFunc) Option
WithIsStatusCodeAnError customizes the function used for deciding whether a given call was an error
Generated by godoc2ghmd