Documentation ¶
Index ¶
- func SetAttributesFromHeaders(_type string, headers HeaderAccessor, span sdk.Span)
- func ShouldRecordBodyOfContentType(h HeaderAccessor) bool
- func WrapHandler(delegate http.Handler, spanFromContext sdk.SpanFromContext, options *Options) http.Handler
- func WrapTransport(delegate http.RoundTripper, spanFromContextRetriever sdk.SpanFromContext) http.RoundTripper
- type HeaderAccessor
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetAttributesFromHeaders ¶
func SetAttributesFromHeaders(_type string, headers HeaderAccessor, span sdk.Span)
SetAttributesFromHeaders set attributes into span from a HeaderAccessor
func ShouldRecordBodyOfContentType ¶
func ShouldRecordBodyOfContentType(h HeaderAccessor) bool
ShouldRecordBodyOfContentType checks if the body is meant to be recorded based on the content-type and the fact that body is not streamed.
func WrapHandler ¶
func WrapHandler(delegate http.Handler, spanFromContext sdk.SpanFromContext, options *Options) http.Handler
WrapHandler wraps an uninstrumented handler (e.g. a handleFunc) and returns a new one that should be used as base to an instrumented handler
func WrapTransport ¶
func WrapTransport(delegate http.RoundTripper, spanFromContextRetriever sdk.SpanFromContext) http.RoundTripper
WrapTransport returns a new http.RoundTripper that should be wrapped by an instrumented http.RoundTripper
Types ¶
type HeaderAccessor ¶
type HeaderAccessor interface { Lookup(key string) []string ForEachHeader(callback func(key string, values []string) error) error }
HeaderAccessor allows accessing HTTP header values.
Go packages use varying data structures and conventions for storing header key-values. Using this interface allows us our functions to not be tied to a particular such format.
func NewHeaderMapAccessor ¶
func NewHeaderMapAccessor(h http.Header) HeaderAccessor
NewHeaderMapAccessor returns a HeaderAccessor