Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
Severity AlertSeverity `json:"severity"`
Subsystem string `json:"subsystem"`
Node string `json:"node"`
Message string `json:"message"`
}
Alert represents a detected issue.
func DeriveAlerts ¶
func DeriveAlerts(snap *ClusterSnapshot) []Alert
DeriveAlerts scans a ClusterSnapshot and produces alerts.
type AlertSeverity ¶
type AlertSeverity string
AlertSeverity represents the severity of an alert.
const ( AlertCritical AlertSeverity = "critical" AlertWarning AlertSeverity = "warning" AlertInfo AlertSeverity = "info" )
type ClusterSnapshot ¶
type ClusterSnapshot struct {
Environment string
CollectedAt time.Time
Duration time.Duration
Nodes []CollectionStatus
Alerts []Alert
}
ClusterSnapshot is the aggregated state of the entire cluster at a point in time.
func CollectOnce ¶
func CollectOnce(ctx context.Context, cfg CollectorConfig) (*ClusterSnapshot, error)
CollectOnce runs `sudo orama node report --json` on all matching nodes in parallel and returns a ClusterSnapshot.
func (*ClusterSnapshot) ByHost ¶
func (cs *ClusterSnapshot) ByHost() map[string]*report.NodeReport
ByHost returns a map of host -> NodeReport for quick lookup.
func (*ClusterSnapshot) Failed ¶
func (cs *ClusterSnapshot) Failed() []CollectionStatus
Failed returns nodes where SSH or parsing failed.
func (*ClusterSnapshot) Healthy ¶
func (cs *ClusterSnapshot) Healthy() []*report.NodeReport
Healthy returns only nodes that reported successfully.
func (*ClusterSnapshot) HealthyCount ¶
func (cs *ClusterSnapshot) HealthyCount() int
HealthyCount returns the number of nodes that reported successfully.
func (*ClusterSnapshot) TotalCount ¶
func (cs *ClusterSnapshot) TotalCount() int
TotalCount returns the total number of nodes attempted.
type CollectionStatus ¶
type CollectionStatus struct {
Node inspector.Node
Report *report.NodeReport
Error error
Duration time.Duration
Retries int
}
CollectionStatus tracks the SSH collection result for a single node.