Skip to content
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

[Canvas] Migrate expression runner from bfetch to an HTTP route #191031

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

lukasolson
Copy link
Member

Summary

Resolves #190267.

Moves the Canvas expression runner off of bfetch and onto the core http router.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@lukasolson lukasolson added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews) labels Aug 21, 2024
@lukasolson lukasolson self-assigned this Aug 21, 2024
@lukasolson
Copy link
Member Author

/ci

@lukasolson
Copy link
Member Author

/ci

@lukasolson
Copy link
Member Author

/ci

@lukasolson lukasolson marked this pull request as ready for review August 26, 2024 21:39
@lukasolson lukasolson requested review from a team as code owners August 26, 2024 21:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@nreese
Copy link
Contributor

nreese commented Aug 27, 2024

Not sure if I am testing correctly, but I am still seeing bfetch requests in canvas. I would expect not to see bsearch request.

Screenshot 2024-08-27 at 8 01 59 AM

@lukasolson
Copy link
Member Author

Not sure if I am testing correctly, but I am still seeing bfetch requests in canvas. I would expect not to see bsearch request.

Any bsearch requests are separate from the route that was migrated as part of this PR. Those are expected if you're using data from either "Elasticsearch SQL" or "Elasticsearch documents" as part of a Canvas data source. The route that has changed in this PR is POST /internal/canvas/fns.

Before this PR, it uses bfetch to batch multiple calls:

before.mov

After this PR, each request goes out individually:

after.mov

@lukasolson lukasolson added the release_note:skip Skip the PR/issue when compiling release notes label Aug 27, 2024
@nreese
Copy link
Contributor

nreese commented Aug 28, 2024

Any bsearch requests are separate from the route that was migrated as part of this PR. Those are expected if you're using data from either "Elasticsearch SQL" or "Elasticsearch documents" as part of a Canvas data source. The route that has changed in this PR is POST /internal/canvas/fns.

Thanks for clarifying. Could you provide an example element expression that uses a function?

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-presentation changes LGTM. Thanks for removing bfetch from canvas.
code review and tested in chrome

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana.jsonc changes LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #65 / Cloud Security Posture Test adding Cloud Security Posture Integrations CSPM AWS CIS_AWS Organization Manual Shared Access CIS_AWS Organization Manual Shared Access Workflow

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
canvas 13.9KB 13.9KB +9.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @lukasolson

@lukasolson lukasolson merged commit f1742db into elastic:main Aug 28, 2024
21 checks passed
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Data, DataViews) Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Canvas] Migrate expression runner from bfetch to an HTTP route
6 participants