monitoring

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 7 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

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

func NewNoopMonitor

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

func (*NoopMonitor) GetService

func (m *NoopMonitor) GetService() string

func (*NoopMonitor) SetDependencyAvailability

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

func (*NoopMonitor) SetResponseTimeMetric

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