observability

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullObserver nullObserverType

Functions

func InstrumentHandler

func InstrumentHandler(method, route string, observer Interface, handler http.Handler) (string, string, http.Handler)

InstrumentHandler is a convenience function

func Register

func Register(observerType string, init InitFunc) error

Register is called by the init functions of the observers

func Registered

func Registered() []string

Registered returns the set of Registered observers

Types

type ErrObserverAlreadyExists

type ErrObserverAlreadyExists string

ErrObserverAlreadyExists is returned if an observer try to register to an observer type that has already registered

func (ErrObserverAlreadyExists) Error

func (err ErrObserverAlreadyExists) Error() string

type ErrObserverIsNotRegistered

type ErrObserverIsNotRegistered string

ErrObserverIsNotRegistered is returned if a requested observer type has not been already registered

func (ErrObserverIsNotRegistered) Error

func (err ErrObserverIsNotRegistered) Error() string

type InitFunc

type InitFunc func(dicter dict.Dicter) (Interface, error)

InitFunc is a function that is used to configure a observer

type Interface

type Interface interface {
	// Handler returns a http.Handler for the metrics route
	Handler(route string) http.Handler
	// InstrumentedHttpHandler returns an http.Handler that will instrument the given http handler, for the
	// route and method that was given
	InstrumentedHttpHandler(method, route string, handler http.Handler) http.Handler

	// Returns the name of observer
	Name() string
}

Interface

func For

func For(observerType string, config dict.Dicter) (Interface, error)

For function returns a configured observer for the given type, and provided config map

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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