-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Rendering partial results when visualizations are backed off the expression language #53336
Comments
Pinging @elastic/kibana-app-arch (Team:AppArch) |
From a Canvas perspective, we've always supported external plugins to write Expression Functions. This kind of change would need to add support for Observables, rather than replace Promises, to avoid breaking 3rd party functions. At the very least, I would propose adding support for Observables, optionally convert Canvas Functions, then deprecate in a future release. It might be interesting to add Observables to the spec, rather than replace |
If we end up needing to go the observables route, I like this idea because it feels less risky. Fully replacing promises with observables is a pretty big paradigm shift in the way we've been thinking/talking about expressions to date. Though expressions are a simple concept at their core, we know people already struggle with understanding them because they can quickly get complex. Having to think about them as streams adds another layer of complexity. An approach like this would help us avoid a hard breaking change for existing integrations, while still giving us the option to go full-observables down the road if it turns out to be the best way to handle expressions.
The more I think about this, the less confident I become 😄. There's also subexpressions to worry about here. What if somebody needs to query something in a function arg as a subexpression? Technically that's still multiple data fetching functions in an expression. In general, I think it'd be hard to enforce a single-data-fetching-fn rule; this is something we'd need to discuss in more depth. |
Another alternative that might not be everything we need (but would certainly be closer) (related to #51245) is to have a separate method for invoking the interpreter that returns an observable. When executing the expression, it would also call |
This seems like a big change for expressions, maybe we should schedule some technical meeting discussing pros/cons of various approaches. Also, I'm currently working on refactoring |
We had a meeting today about running expressions server side for alerting purposes. I was not thinking about that aspect in this context. When we do start thinking more seriously about this, we should keep that in mind: #50270. But, this is likely not something we will tackle until 8.x. We will probably have figured out server side expression execution first. |
i think we first need to better identify the problem. What exactly do we mean with partial results and where do they make sense ? imo partial results don't make sense in most cases inside kibana. i think with partial results we want Defining and scoping the problem better might help us to better think about the infrastructure needed to support it. |
our search infrastructure is close to ready so we are starting active work on adding partial support to expressions in the next minor. closing in favor of #84051 |
Partial results are returned from our search services via an Observable but the interpreter and expression functions currently expect promises.
In order to show partial results rendering, we want to execute the remainder of an expression every time the expression fn fires.
One corner case that could cause issues is if a subsequent search fn relies on output from an earlier search fn. That could create a slew of search requests. e.g.:
essql "select max(val) as val from foo" | joinOn table="essql 'select * from bar where ${val} > 100'" | render debug
I know this string is wrong, but however you write it, the point is that the second query relies on the first. The request cache would miss every time that value changes. We'd want to abort those requests as soon as they aren't needed.
However for almost all intents and purposes there is only a single data fetching fn per expression. If we can solve some of the make it slow issues on that assumption (if it's true, @lukasolson did point out a real situation we do use two queries... so maybe this would be a problem, needs investigation), but if we could force only a single data fetching fn, or at least have decent fallback behavior, I think that would solve the majority of use cases.
cc @lukasolson @lukeelmers @alexh97
The text was updated successfully, but these errors were encountered: