monitoring

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IDPathRegex regexp used to swap the {id*} parameters in the path with simply id
	// supports alphabetic characters and underscores, no dashes
	IDPathRegex string = "{[a-zA-Z_]*}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware is the monitoring middleware object implementing Prometheus monitoring

func NewMiddleware

func NewMiddleware(monitor MonitorInterface, logger logging.LoggerInterface) *Middleware

NewMiddleware returns a Middleware based on the type of monitor

func (*Middleware) ResponseTime

func (mdw *Middleware) ResponseTime() func(http.Handler) http.Handler

type MonitorInterface

type MonitorInterface interface {
	GetService() string
	SetResponseTimeMetric(map[string]string, float64) error
	SetDependencyAvailability(map[string]string, float64) error
}

type NoopMonitor added in v0.12.0

type NoopMonitor struct {
	// contains filtered or unexported fields
}

func NewNoopMonitor added in v0.12.0

func NewNoopMonitor(service string, logger logging.LoggerInterface) *NoopMonitor

func (*NoopMonitor) GetService added in v0.12.0

func (m *NoopMonitor) GetService() string

func (*NoopMonitor) SetDependencyAvailability added in v0.12.0

func (m *NoopMonitor) SetDependencyAvailability(map[string]string, float64) error

func (*NoopMonitor) SetResponseTimeMetric added in v0.12.0

func (m *NoopMonitor) SetResponseTimeMetric(map[string]string, float64) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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