-
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
Data formatting and manipulation support for Alert payloads #77793
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
Creating alerts with Kibana expressions is still fairly out (#50270). I wonder if there's anything with expressions that could solve this requirement. |
Curious about thoughts on executing arbitrary painless code from Kibana. Below is what the painless lab is doing - is this the recommended approach? That part seems pretty straight-forward, if so. kibana/x-pack/plugins/painless_lab/server/routes/api/execute.ts Lines 25 to 29 in 4b49e5a
The hard part would be figuring out how this all fits together. Do we allow action parameters to be "scripted" as well as supporting the built-in mustache templating? How would this work in the UI? How do the shape of the action parameters change to accommodate this? I think we should start with some specific scenarios from customers here, if they're already chiming in. What kind of things are they expecting to be able to do? |
@arisonl @alexfrancoeur I think this issue is a near-duplicate of #89161 but not a 1-to-1 overlap. Should they be merged into one? Should we dedup the parts that are the same? cc @mikecote |
Since this was opened, we've extended mustache to support some data manipulation like date, number formatting, in the following PRs:
Presumably additional manipulations can be added in the same fashion. Since no other specific manipulations were mentioned here, I'm going to close. As a further note, we have done some experiments trying to use expressions somehow, but the problem is that our current path through mustache templating is synchronous, and using expressions would require async. As would painless support. Painless would be a bit painful given the extra network hop and potentially huge payloads of the alert context to process. |
Also note that with ES|QL support, it should be possible to do some amount of "manipulation" within the queries sent to ES. |
We've received a request where it would be useful to use painless to transform the data returned before sending off to a 3rd party integration. This could be PagerDuty, ServiceNow, etc. This makes it much easier for the consumer of the incident to understand the data coming through.
Painless is a language that is already in use with Watcher, so there is an argument and preference for this syntax over others. Having to learn another language adds additional overhead. The alternative, and one I believe we've been leaning towards in the past, is to use Kibana expressions and functions to provide this level of transformation and flexibility.
This issue is meant to track the enhancement request and will need to be discussed and prioritized accordingly. This request has some similarities to #76910.
The text was updated successfully, but these errors were encountered: