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
Support all pagerduty_config options in AlertmanagerConfig crd #6387
Comments
All fields may not be present in AlertmanagerConfig CRD as its still developing, so if there is a feature request that can be added. IIUC you want to add |
@slashpai This makes sense, It appears that just |
Do you want to contribute to change? |
@slashpai i want to solve this issue. |
Here is a example PR #5886 how to add fields in alertmanagerconfigs A general idea: Add to https://github.com/prometheus-operator/prometheus-operator/blob/main/pkg/alertmanager/types.go Run make generate Add code to add in configs to amcfg.go and tests in amcfg_test.go |
Thanks for the details, @Ayush9026 I have time to work on this next week if you don't get a chance. Thanks everyone! |
The AlertManager CRD was expected to have 1:1 fields mapped from https://prometheus.io/docs/alerting/latest/configuration/#pagerduty_config . Currently source was missing so it is added. Fixes prometheus-operator#6387
Hi @slashpai
{
name: "Test source is dropped in pagerduty config for unsupported versions",
againstVersion: semver.Version{Major: 0, Minor: 24},
in: &alertmanagerConfig{
Receivers: []*receiver{
{
PagerdutyConfigs: []*pagerdutyConfig{
{
Source: "foo",
},
},
},
},
},
expect: alertmanagerConfig{
Receivers: []*receiver{
{
PagerdutyConfigs: []*pagerdutyConfig{
{
Source: "",
},
},
},
},
}
} I am not sure then if I needed to add any more tests about the Source field as it is an optional template string field. What do you think ? I am just trying to understand the project better as I want to contribute to kubernetes community. Would really help if you can take out time to answer these questions. Thanks a lot. |
Whenever Alertmanager adds a new option from operator's side 2 things we need to do:
This was supported in static config thats why he said in issue it worked there but this option was not supported in AlertmanagerConfig CRD which is a kubernetes native way to define alertmanager config. |
Adding to what JP said, the |
Hi @slashpai , Does it make sense to open a new issue for checking for other fields which are optional but pointer type has not been used for them ? I can work creating a PR for that. |
Component(s)
AlertManagerConfig
What is missing? Please describe.
Currently walking through going from a static alertmanager config to a more dynamic approach using alertmanagerconfig crds. Immediately noticed that there are a few fields missing in the crd for the pagerduty_config options. I had assumed they weren't mapped 1:1 but they appear to be.
Using alertmanager config directly I can use source and other fields without issue, going through the alertmanagerconfig CRD is an issue since not all fields are exposed at that level.
https://prometheus.io/docs/alerting/latest/configuration/#pagerduty_config
https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#pagerdutyconfig
Describe alternatives you've considered.
N/A
Environment Information.
Environment
Kubernetes Version: 1.26
Prometheus-Operator Version: 72.0
The text was updated successfully, but these errors were encountered: