feat(alerting): add monitor alert groups with default routing
This commit is contained in:
1 parent
52819e64bb
commit
8544e5a585
26 files changed
+2938
-1473
No files matched your search
@@ -241,30 +241,6 @@ func (q *Queries) ListChannels(ctx context.Context) ([]NotificationChannel, erro
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const listEnabledChannelIDs = `-- name: ListEnabledChannelIDs :many
|
||||
SELECT id FROM notification_channels WHERE org_id = $1 AND enabled
|
||||
`
|
||||
|
||||
func (q *Queries) ListEnabledChannelIDs(ctx context.Context, orgID uuid.UUID) ([]uuid.UUID, error) {
|
||||
rows, err := q.db.Query(ctx, listEnabledChannelIDs, orgID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
items := []uuid.UUID{}
|
||||
for rows.Next() {
|
||||
var id uuid.UUID
|
||||
if err := rows.Scan(&id); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, id)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const listIncidents = `-- name: ListIncidents :many
|
||||
SELECT i.id, i.org_id, i.monitor_id, i.started_at, i.resolved_at, i.cause, m.name AS monitor_name
|
||||
FROM incidents i
|
||||
|
||||
Reference in new issue
Block a user