http

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

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

type Options

type Options struct {
	Filter filter.Filter
}

Options for HTTP handler instrumentation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL