Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: notification eval period #1204

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions models/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Notification struct {
Namespace string `json:"namespace,omitempty"`
Events pq.StringArray `json:"events" gorm:"type:[]text"`
Title string `json:"title,omitempty"`
WaitFor *time.Duration `json:"wait_for,omitempty"`
Template string `json:"template,omitempty"`
Filter string `json:"filter,omitempty"`
PersonID *uuid.UUID `json:"person_id,omitempty"`
Expand All @@ -31,7 +30,14 @@ type Notification struct {
CreatedAt time.Time `json:"created_at" time_format:"postgres_timestamp" gorm:"<-:false"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`

// Error stores errors in notification filters (if any)
// Duration to wait before re-evaluating health of the resource.
WaitFor *time.Duration `json:"wait_for,omitempty"`

// Duration to wait after triggering incremental scrape for kubernetes config.
// Works together with waitFor duration.
WaitForEvalPeriod *time.Duration `json:"wait_for_eval_period,omitempty"`

// Error stores errors in notification filters (if any).
Error *string `json:"error,omitempty"`
}

Expand Down
5 changes: 5 additions & 0 deletions schema/notifications.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ table "notifications" {
type = bigint
comment = "duration in nanoseconds"
}
column "wait_for_eval_period" {
null = true
type = bigint
comment = "duration in nanoseconds"
}
column "group_by" {
null = true
type = sql("text[]")
Expand Down
Loading