Documentation ¶
Index ¶
- Constants
- Variables
- func Cleanup()
- func InstrumentAPIHandler(method, route string, observer APIObserver, handler http.Handler) (string, string, http.Handler)
- func InstrumentViewerHandler(method, route string, observer ViewerObserver, handler http.Handler) (string, string, http.Handler)
- func LabelForObserveVar(key string) string
- func Register(observerType string, init InitFunc, cleanup CleanUpFunc) error
- func Registered() []string
- type APIObserver
- type Cache
- type CacheObserver
- type CleanUpFunc
- type Collector
- type ErrObserverAlreadyExists
- type ErrObserverIsNotRegistered
- type InitFunc
- type Interface
- type Observer
- type ViewerObserver
Constants ¶
View Source
const ( ObserveVarMapName = ":map_name" ObserveVarLayerName = ":layer_name" ObserveVarTileX = ":x" ObserveVarTileY = ":y" ObserveVarTileZ = ":z" )
Variables ¶
View Source
var NullObserver observer.Null
Functions ¶
func Cleanup ¶ added in v0.14.0
func Cleanup()
Cleanup should be called before shutting down the process; this allows and observers to clean, and maybe push any results it may have collected.
func InstrumentAPIHandler ¶ added in v0.14.0
func InstrumentAPIHandler(method, route string, observer APIObserver, handler http.Handler) (string, string, http.Handler)
InstrumentAPIHandler is a convenience function
func InstrumentViewerHandler ¶ added in v0.14.0
func InstrumentViewerHandler(method, route string, observer ViewerObserver, handler http.Handler) (string, string, http.Handler)
InstrumentViewHandler is a convenience function
func LabelForObserveVar ¶ added in v0.14.0
Types ¶
type APIObserver ¶ added in v0.14.0
type Cache ¶ added in v0.14.0
type Cache interface { tegolaCache.Interface tegolaCache.Wrapped IsObserver() bool }
type CacheObserver ¶ added in v0.14.0
type CacheObserver interface {
InstrumentedCache(cacheObject tegolaCache.Interface) tegolaCache.Interface
}
type CleanUpFunc ¶ added in v0.14.0
type CleanUpFunc func()
CleanUpFunc is a function that is called before the process ends.
type Collector ¶ added in v0.14.0
type Collector = prometheus.Collector
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 Interface ¶
type Interface interface { // Handler returns a http.Handler for the metrics route Handler(route string) http.Handler // Returns the name of observer Name() string // Init should setup any processing that should be done once the application is actually starting Init() // Shutdown should shutdown any subsystems that Init setup Shutdown() // MustRegister will register any custom collectors. It will panic if there is an error MustRegister(collectors ...Collector) // CollectorConfig returns the config for a given key, or nil, if the key does not exist CollectorConfig(key string) map[string]interface{} APIObserver ViewerObserver CacheObserver }
Interface
type Observer ¶ added in v0.14.0
type Observer interface { // Collectors should return a set of collectors that will be registered by the default observability provider, // to get the configuration; use the provided function and your config key. Collectors(prefix string, config func(configKey string) map[string]interface{}) ([]Collector, error) }
Observer is able to be observed via the collectors it provides
type ViewerObserver ¶ added in v0.14.0
Click to show internal directories.
Click to hide internal directories.