Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor object
func NewMonitor ¶
func NewMonitor(cfg MonitorConfigInterface) *Monitor
NewMonitor returns a MonitorInterface, an enhancement (transitioning) on MonitorService
func (*Monitor) AddMetric ¶
func (m *Monitor) AddMetric(metric types.MetricInterface) error
AddMetric will try to register the metric passed in, if already present it will Unregister them so that the newest added is the one used by definition from https://github.com/prometheus/client_golang/blob/main/prometheus/registry.go#L121 Two Collectors are considered equal if their Describe method yields the same set of descriptors.
func (*Monitor) AddMetrics ¶
func (m *Monitor) AddMetrics(metrics ...types.MetricInterface) error
AddMetrics will try to register the metrics passed in, if already present it will Unregister them so that the newest added is the one used by definition from https://github.com/prometheus/client_golang/blob/main/prometheus/registry.go#L121 Two Collectors are considered equal if their Describe method yields the same set of descriptors.
func (*Monitor) GetLogger ¶
func (m *Monitor) GetLogger() logging.LoggerInterface
func (*Monitor) GetMetric ¶
func (m *Monitor) GetMetric(metric string) (types.MetricInterface, error)
func (*Monitor) GetService ¶
type MonitorConfigInterface ¶
type MonitorConfigInterface interface { GetMetrics() []types.MetricInterface GetService() string GetLogger() logging.LoggerInterface }
type MonitorInterface ¶
type MonitorInterface interface { GetService() string GetMetric(string) (types.MetricInterface, error) AddMetrics(...types.MetricInterface) error AddMetric(types.MetricInterface) error }
MonitorInterface interface TODO @shipperizer bad pattern exposing internal types as interfaces, refactor