We want to support dashboard / discover variables on the ES|QL mode / charts. The journey should start from the editor. We want to suggest a Create control suggestion which will open a flyout and the users will be able to create a control:
A static values one where the users give the options manually
A derived from the ES|QL query one where the options are been executed from the ES|QL query
The flyout should be on its own package / plugin and we need to register a new UI action to execute it. (passing all the important information from the editor). So the variables plugin register an action, the editor triggers it and the flyout is rendered.
OnSave (flyout CTA) the control should:
Create the control and embed it to the dashboard
Pass the variable into the Lens embeddable in order to update the ES|QL query
The dashboard should send to the Lens embeddable(s) the available variables (in case there are controls already in the dashboard). With this way the editor will be able to suggest them. The editor needs to know what kind of variables they are (values, fields, functions) in order to suggest them only where they are supported
Lens needs to send this information on the expressions too (in order to successfully create the request). I think the variable name and type is sufficient here
There are plenty of questions we need to answer:
Can I easily know the type of control? (value, field, interval)
If not, which changes should I do to my APIs in order to accomplish this?
Can I be smart? Ideally I want to retrieve the previous field from the assertion (operator) and create the ES|QL query to retrieve the values. What needs to change to accomplish this?
The values do not appear only after operators but also inside functions (such as MATCH). How can I get the field then?
Can I know that the current function gets intervals? If not, what do I need to change to get this? Do I need something from ES?
Same for fields
How do I recognize that I have custom variables in my editor and also recognize the type? This needs a change in our parser API
Where do the flyouts live? (I think they need to live in their own package.)
How do I create controls on the fly?
How does the dashboard passes the control context into the Lens embeddable?
The purpose of this spike is to identify:
technical obstacles
things we need from the various components involved
Describe the feature:
We want to support dashboard / discover variables on the ES|QL mode / charts. The journey should start from the editor. We want to suggest a
Create control
suggestion which will open a flyout and the users will be able to create a control:The flyout should be on its own package / plugin and we need to register a new UI action to execute it. (passing all the important information from the editor). So the variables plugin register an action, the editor triggers it and the flyout is rendered.
OnSave (flyout CTA) the control should:
There are plenty of questions we need to answer:
The purpose of this spike is to identify: