-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Alertmanager ttl #6371
base: main
Are you sure you want to change the base?
Alertmanager ttl #6371
Conversation
Signed-off-by: aerosouund <aerosound161@gmail.com>
Signed-off-by: aerosouund <aerosound161@gmail.com>
Signed-off-by: aerosouund <aerosound161@gmail.com>
@aerosouund you have added the field that is good,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting the PR!
The changes made to the API are almost there, we also want to incorporate the changes you've made to the API to the alertmanager packages, i.e. we want to write this configuration in Alertmanager's config files if it is set.
@slashpai shared some directions here: #6360 (comment)
go 1.22 | ||
go 1.22.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this change intentional?
@@ -29,6 +29,7 @@ import ( | |||
// https://github.com/prometheus/alertmanager/issues/1985 | |||
type alertmanagerConfig struct { | |||
Global *globalConfig `yaml:"global,omitempty" json:"global,omitempty"` | |||
TTL duration `yaml:"ttl,omitempty" json:"ttl,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a linting problem here, you can fix it by running make format
:)
@@ -783,6 +784,9 @@ type PushoverConfig struct { | |||
// Notification title. | |||
// +optional | |||
Title string `json:"title,omitempty"` | |||
// time to live for the alert notification | |||
// +optional | |||
TTL time.Duration `json:"ttl,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TTL time.Duration `json:"ttl,omitempty"` | |
TTL *Duration `json:"ttl,omitempty"` |
We have a custom Duration type, which has some useful validations on the API level. Could we use this one instead?
Also, we follow k8s API conventions as much as possible, which means we want to use pointers for optional fields.
Description
Add TTL field to alertmanager config
solves: #6360
Type of change
CHANGE
(fix or feature that would cause existing functionality to not work as expected)FEATURE
(non-breaking change which adds functionality)BUGFIX
(non-breaking change which fixes an issue)ENHANCEMENT
(non-breaking change which improves existing functionality)NONE
(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.
Changelog entry