-
Notifications
You must be signed in to change notification settings - Fork 91
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
[Bug] Importing/Creating alerting rules in cluster management not working due to notify_when parameter #524
Comments
Cross-posting @jpdjere's comment on previous discussion. For Alerting-level Rule updates, since Kibana's ResponseOps team finalized elastic/kibana#143368 via elastic/kibana#144130 the Rule-level |
As a kind of meta-question on this, it's not clear how this is tested, but feels like we should do some kind of E2E testing at least once per release (first bc?) to make sure API changes have not broken this provider. If there is already some kind of test like this, we apparently need more, as we should have been able to catch this. If there isn't, we should build one. |
There's acceptance tests for this resource which are run against a range of stack versions. The existing tests do explicitly check the |
@tobio IIUC this is purely a TF issue now? (initially looked like a Kibana API issue?) |
No, it wasn't. After the upgrade to the version, it's working now. Thanks |
IIRC the API spec has changed dramatically since these resources were introduced. We likely want to regenerate the client and decide on how much effort we put into supporting early API version here too. |
@tobio so the path here is basically creating a new resource from the newer sec IIUC? |
I think it's regenerating the client and making the current resource work with the latest version. There's potentially some version restrictions tie figure out (e.g ES 8.8- requires the current provider version), but we'd have to look at the spec changes to know. |
Thanks for looking into this topic. @tobio Did you maybe managed to regenerate the client? I'm really looking forward to use this resource with latest Elastic Cloud version. |
@tobio Did you maybe have time to take look into this issue? |
I've only been able to look at this to verify that it's not simply an hours work and that there's a bunch of breaking changes in the API spec we'd need to adapt to sadly. |
Fixed by elastic/kibana#186963. Starting from v0.11.7, the Rule resource now supports the rule's |
Describe the bug
I'm importing alert rules and the alert rule, as created in the GUI, does not have
notify_when
set. The rule is configured with a filter query.notify_when
is a required parameter in the Terraform resource. When I setnotify_when
in my terraform config and redeploy, it breaks the alerting rule in Kibana, as it no longer honors the filter rule and constantly sends me alerts. I also, can no longer modify the rule in Kibana, as it gives me an internal server error message.The same issue occurs when I initiate rule creation directly from Terraform. It creates the rule successfully, but then any subsequent update tries to repopulate the
notify_when
parameter. The rule is broken on creation.To Reproduce
Steps to reproduce the behavior:
vars:
terraform plan
,terraform apply
,terraform destroy
]The policy before import:
The Terraform Changeset after import:
The object after redeploying with Terraform:
Note now that the action item
frequency
params are no longer there.Expected behavior
Import or create the policy to produce a working alerting rule
Screenshots
The kibana error when attempting to save the rule via the kibana dashboard after modification to the rule:
Versions (please complete the following information):
Additional context
I tried to address this with my limited go knowledge but was unsuccessful. I did get as far as just setting the value for notify_when to null to see what it would do. Elasticsearch then complained that the rule actions were missing their frequency parameters.
The text was updated successfully, but these errors were encountered: