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
}
func NewMonitor ¶
func NewMonitor(config MonitorConfig, log *mlog.Logger) (*Monitor, error)
NewMonitor creates and initializes a new Monitor.
type MonitorConfig ¶
type MonitorConfig struct { // The URL of the Prometheus server to query. PrometheusURL string `default:"http://localhost:9090" validate:"url"` // The time interval in milliseconds to wait before querying again. UpdateIntervalMs int `default:"2000" validate:"range:[1000,]"` // The slice of queries to run. Queries []prometheus.Query `default_size:"0"` }
MonitorConfig holds the necessary information to create a Monitor.
func (MonitorConfig) IsValid ¶
func (c MonitorConfig) IsValid() error
IsValid checks whether a MonitorConfig is valid or not. Returns an error if the validation fails.
Click to show internal directories.
Click to hide internal directories.