Documentation
¶
Overview ¶
Package monitor is the alerting engine. It watches container state (Docker events), resource usage (polled stats), restart frequency, and log output, evaluates user-defined rules, and dispatches matches to the in-app feed and configured webhooks. It also maintains a stats snapshot for the Prometheus exporter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendMail ¶
func SendMail(cfg store.SMTPConfig, subject, body string) error
SendMail delivers one message via the configured SMTP server. It supports implicit TLS (cfg.TLS, e.g. port 465) and otherwise lets net/smtp negotiate STARTTLS when the server offers it. Exported so the API can send a test mail.
Types ¶
type ContainerStat ¶
type ContainerStat struct {
HostID int64
HostName string
ID string
Name string
State string
CPUPercent float64
MemBytes uint64
MemPercent float64
}
ContainerStat is the cached per-container snapshot used by the exporter.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is the long-running alert engine.
func (*Monitor) Snapshot ¶
func (m *Monitor) Snapshot() []ContainerStat
Snapshot returns a copy of the latest per-container stats for the exporter.