-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Alerting] discrepancy in typing of index threshold "index" parameter - server vs ui #68575
Labels
Feature:Alerting
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
Comments
pmuellr
added
Feature:Alerting
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
labels
Jun 8, 2020
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
I'm tempted to change the alert type to make the index a string array, matching the ui, however it is possible someone has already created alerts with a string value instead of a string array. So it seems like we'll need to change the UI to be more flexible and support |
pmuellr
added a commit
to pmuellr/kibana
that referenced
this issue
Jan 15, 2021
resolves elastic#68575 The index threshold alert defines an `index` parameter which is typed as `string | string[]`. However the UI for this alert has been typing it as only `string[]`. This PR changes the UI to work with an incoming string value for this parameter. If the parameter is edited in the UI, it will always be set as an array, even if there is only one element.
1 task
pmuellr
added a commit
that referenced
this issue
Jan 25, 2021
…8540) resolves #68575 The index threshold alert defines an `index` parameter which is typed as `string | string[]`. However the UI for this alert has been typing it as only `string[]`. This PR changes the UI to work with an incoming string value for this parameter. If the parameter is edited in the UI, it will always be set as an array, even if there is only one element.
pmuellr
added a commit
to pmuellr/kibana
that referenced
this issue
Jan 25, 2021
…astic#88540) resolves elastic#68575 The index threshold alert defines an `index` parameter which is typed as `string | string[]`. However the UI for this alert has been typing it as only `string[]`. This PR changes the UI to work with an incoming string value for this parameter. If the parameter is edited in the UI, it will always be set as an array, even if there is only one element.
pmuellr
added a commit
that referenced
this issue
Jan 26, 2021
…8540) (#89236) resolves #68575 The index threshold alert defines an `index` parameter which is typed as `string | string[]`. However the UI for this alert has been typing it as only `string[]`. This PR changes the UI to work with an incoming string value for this parameter. If the parameter is edited in the UI, it will always be set as an array, even if there is only one element.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Feature:Alerting
Team:ResponseOps
Label for the ResponseOps team (formerly the Cases and Alerting teams)
I just noticed that I got an error thrown in the UI when I tried to display an alert I created with
kbn-alert
.The error occurred here:
kibana/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.tsx
Line 186 in f090775
At this point, the value of
index
was a string, but the code assumed it was an array. That's what's specified in it's type:kibana/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/types.ts
Lines 27 to 28 in 1e45e98
However, the alert type itself has
index
spec'd asstring || string[]
:kibana/x-pack/plugins/alerting_builtins/server/alert_types/index_threshold/lib/core_query_types.ts
Lines 14 to 19 in 1e45e98
So, that all makes sense, the alert was created at the API level, not the UI, and passed it's validation, but that shape is not valid within the UI.
I'm a little surprised at seeing this, it seems to indicate that I haven't edited in the UI and alerts I've created at the command-line, but ... I'd swear I have. Ah well ...
We'll need to fix this up so they are compatible.
The text was updated successfully, but these errors were encountered: