global events: notification bell feed + exclude client_error from operator alerts
This commit is contained in:
parent
34d4a02826
commit
44d7e3dd66
3 changed files with 93 additions and 5 deletions
|
|
@ -480,11 +480,13 @@ func (q *AgentQueries) GetAgentEvents(agentID uuid.UUID, severity string, limit
|
|||
|
||||
// GetGlobalEvents retrieves recent system events across all agents.
|
||||
// Used by the notification bell to surface fleet-wide activity.
|
||||
// Excludes client_error events — those are frontend diagnostics, not operator alerts.
|
||||
func (q *AgentQueries) GetGlobalEvents(severity string, limit int) ([]models.SystemEvent, error) {
|
||||
query := `
|
||||
SELECT id, agent_id, event_type, event_subtype, severity, component,
|
||||
message, metadata, created_at
|
||||
FROM system_events
|
||||
WHERE event_type != 'client_error'
|
||||
ORDER BY created_at DESC
|
||||
LIMIT $1
|
||||
`
|
||||
|
|
@ -495,7 +497,8 @@ func (q *AgentQueries) GetGlobalEvents(severity string, limit int) ([]models.Sys
|
|||
SELECT id, agent_id, event_type, event_subtype, severity, component,
|
||||
message, metadata, created_at
|
||||
FROM system_events
|
||||
WHERE severity = ANY(string_to_array($1, ','))
|
||||
WHERE event_type != 'client_error'
|
||||
AND severity = ANY(string_to_array($1, ','))
|
||||
ORDER BY created_at DESC
|
||||
LIMIT $2
|
||||
`
|
||||
|
|
|
|||
Loading…
Reference in a new issue