Documentation
¶
Index ¶
- func FindConfigFile(overridePath string) string
- func GetDefaultConfigPath() string
- type AgentConfig
- type AlertsConfig
- type AnomalyConfig
- type CollectorsConfig
- type Config
- type DashboardConfig
- type DockerConfig
- type KubernetesConfig
- type ProcessAlert
- type PrometheusConfig
- type StorageConfig
- type ThresholdAlert
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConfigFile ¶
FindConfigFile searches for config files in standard locations.
func GetDefaultConfigPath ¶
func GetDefaultConfigPath() string
GetDefaultConfigPath returns the default location for config.yaml.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Enabled bool `yaml:"enabled"`
Port int `yaml:"port"`
BindAddress string `yaml:"bind_address"`
Token string `yaml:"token"`
TLSCert string `yaml:"tls_cert"`
TLSKey string `yaml:"tls_key"`
}
AgentConfig configures the remote agent server.
type AlertsConfig ¶
type AlertsConfig struct {
CPU ThresholdAlert `yaml:"cpu"`
Memory ThresholdAlert `yaml:"memory"`
Disk ThresholdAlert `yaml:"disk"`
Process ProcessAlert `yaml:"process"`
Network ThresholdAlert `yaml:"network"`
}
AlertsConfig bundles all alert thresholds.
type AnomalyConfig ¶
type AnomalyConfig struct {
Enabled bool `yaml:"enabled"`
ZScoreThreshold float64 `yaml:"z_score_threshold"`
WindowSize int `yaml:"window_size"`
Alpha float64 `yaml:"alpha"` // EWMA factor
}
AnomalyConfig configures the statistical anomaly detector.
type CollectorsConfig ¶
type CollectorsConfig struct {
CPU bool `yaml:"cpu"`
Memory bool `yaml:"memory"`
Disk bool `yaml:"disk"`
Network bool `yaml:"network"`
Process bool `yaml:"process"`
Service bool `yaml:"service"`
Port bool `yaml:"port"`
Docker bool `yaml:"docker"`
Kubernetes bool `yaml:"kubernetes"`
}
CollectorsConfig specifies which collectors are enabled.
type Config ¶
type Config struct {
RefreshInterval time.Duration `yaml:"refresh_interval"`
Storage StorageConfig `yaml:"storage"`
Alerts AlertsConfig `yaml:"alerts"`
Anomaly AnomalyConfig `yaml:"anomaly"`
Collectors CollectorsConfig `yaml:"collectors"`
Dashboard DashboardConfig `yaml:"dashboard"`
Prometheus PrometheusConfig `yaml:"prometheus"`
Agent AgentConfig `yaml:"agent"`
Docker DockerConfig `yaml:"docker"`
Kubernetes KubernetesConfig `yaml:"kubernetes"`
}
Config is the root configuration structure for Watchdog.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a fully populated, production-ready configuration.
type DashboardConfig ¶
type DashboardConfig struct {
Theme string `yaml:"theme"`
ShowPerCoreCPU bool `yaml:"show_per_core_cpu"`
ProcessSortBy string `yaml:"process_sort_by"`
ProcessLimit int `yaml:"process_limit"`
PauseOnStart bool `yaml:"pause_on_start"`
}
DashboardConfig configures TUI appearance and defaults.
type DockerConfig ¶
DockerConfig configures Docker container monitoring.
type KubernetesConfig ¶
type KubernetesConfig struct {
Enabled bool `yaml:"enabled"`
Kubeconfig string `yaml:"kubeconfig"`
Namespace string `yaml:"namespace"`
}
KubernetesConfig configures Kubernetes monitoring.
type ProcessAlert ¶
type ProcessAlert struct {
Enabled bool `yaml:"enabled"`
CPUThreshold float64 `yaml:"cpu_threshold"`
MemoryThreshold float64 `yaml:"memory_threshold"`
Cooldown time.Duration `yaml:"cooldown"`
}
ProcessAlert defines process-specific alert thresholds.
type PrometheusConfig ¶
type PrometheusConfig struct {
Enabled bool `yaml:"enabled"`
Port int `yaml:"port"`
Path string `yaml:"path"`
}
PrometheusConfig configures Prometheus metrics exporter.