-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Lens] Register all expression functions to the server #97134
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
there's a concern coming on this work in the future (not this issue): how does time zone get included as part of the execution context if we are moving things server side. for reporting we include time zone in the saved object. we can do this task (moving logic to server) as long as the client is initiating the request...but as soon as we take on async reporting or csv export we need a way to pass in the time zone in some way. need an issue for this |
@ghudgins The approach that reporting has taken for time zones is one that would also work for Lens, I believe this is already a solved problem. If a user doesn't pass the time zone to the reporting task, then it will fall back to the |
@wylieconlon The "difficult" part here is that we would run an expression for these use cases (alerting/aggregated csv reporting) which is async for each function execution. So basically we would need to pass the current time zone to each expression function which would have to change the global moment timezone to the one of the current execution, then set it back to the server default (otherwise it can interfere with other runs). Maybe the interpreter can do this in a single place so we don't have to make sure each function is handling it. Right now I think we would have an issue with time shifts and time scaling (both of them using |
Meta issue: #71560 Some related issues: |
Next steps:
|
Part of: #97134 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Part of: elastic#97134 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
elastic#108366) Part of: elastic#97134 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
the goal is achieved, the functions are available on the server, issue can be closed |
To make it possible to run Lens expressions on the Kibana server (for features like alerting), all expression functions have to be registered on the server as well as on the client. To do that, they have to be moved to a central
common
folder in the plugin folder, and imported and registered in the server side plugin as well as the current registration on the client side.List of functions:
lens_time_scale
lens_counter_rate
lens_rename_columns
lens_format_column
lens_datatable_column
lens_datatable
(relies on field formatter service)lens_metric_chart
lens_pie
lens_xy_legendConfig
lens_xy_yConfig
lens_xy_tickLabelsConfig
lens_xy_gridlinesConfig
lens_xy_axisTitlesVisibilityConfig
lens_xy_layer
lens_xy_chart
We also have to move the suffix formatter to the server because the datatable function depends on field formatters
x-pack/plugins/lens/public/indexpattern_datasource/suffix_formatter.ts
The text was updated successfully, but these errors were encountered: