channelhealth: controller->agent channel health-check (periodic probe + classified operator alert) v0.90.0
New internal/channelhealth Checker: ~60s probe via the PRODUCTION memoized client (Server.ProbeAgentChannel, GET /storage), classifies failures (spike Q1 map), debounces transient reasons (N>=2; construction error latches distinctly), seeds first obs, alerts operator+dashboard on transition. Notifier.NotifyAgentChannelDown/Recovered (English, operator-only), AlertManager dashboard banner (Hungarian). No agent/hub change. Spike-proven. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EPZ4GJ8L5Jqf8UiPwbn1kt
This commit is contained in:
@@ -335,6 +335,26 @@ func (n *Notifier) NotifyStorageReconnected(label string) {
|
||||
fmt.Sprintf("Meghajtó újra csatlakoztatva: %s", label), StorageDetails{Label: label})
|
||||
}
|
||||
|
||||
// AgentChannelDetails carries the classified reason for a controller→agent channel-down event.
|
||||
type AgentChannelDetails struct {
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
// NotifyAgentChannelDown sends an OPERATOR-facing controller→agent channel-down event (the message is
|
||||
// English — the customer can't act on "the agent re-keyed", so this never reaches them: the event type
|
||||
// is not a customer notification toggle, same as the host_* operator events). eventType/severity/
|
||||
// message come from the channelhealth classifier (spike Q1 map).
|
||||
func (n *Notifier) NotifyAgentChannelDown(reason, eventType, severity, message string) {
|
||||
n.PushEvent(eventType, severity, message, AgentChannelDetails{Reason: reason})
|
||||
}
|
||||
|
||||
// NotifyAgentChannelRecovered sends the recovery event (info → logged, no email, mirrors
|
||||
// storage_reconnected).
|
||||
func (n *Notifier) NotifyAgentChannelRecovered() {
|
||||
n.PushEvent("agent_channel_recovered", "info",
|
||||
"Controller→agent channel recovered — local-API reachable again.", nil)
|
||||
}
|
||||
|
||||
// NotifyAppDeployed sends an app deployment event.
|
||||
func (n *Notifier) NotifyAppDeployed(stackName, displayName string) {
|
||||
n.PushEvent("app_deployed", "info",
|
||||
@@ -630,4 +650,3 @@ func statusRank(status string) int {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user