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

Add rollupSearchStrategy #20505

Merged
merged 4 commits into from
Jul 23, 2018

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Jul 6, 2018

Partially addresses #20004:

  • Create API endpoint for executing a rollups search
  • Add rollupSearchStrategy for hitting this endpoint
  • Create an adapter that wraps a rollup search but presents the same interface as an esPromise (the promise-like object returned by the elasticsearch-js lib).
  • Create an adapter that resolves this promise with a result object that has the same shape as that returned by a resolving esPromise.
  • Reformat body argument into correct payload shape
  • Validate and/or set correct intervals and timezone
  • Blocked by Delegate surfacing of Courier errors to the consumer #21056
  • Surface error callout in the sidebar
  • Batch together requests to hit a bulk rollup search endpoint
  • Implement failedSearchRequests in rollupSearchStrategy

image

Errors

All Visualize errors (including rollup errors) are now displayed as toasts. Rollup errors will also be surfaced in the sidebar, where they'll persist until the next request.

image

image

image

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

- Add logic to rollupSearchStrategy for extracting criteria for the rollup search.
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@cjcenizal cjcenizal force-pushed the rollup-search-strategy branch 2 times, most recently from 74d5360 to f17a051 Compare July 20, 2018 23:45
@elasticmachine
Copy link
Contributor

💔 Build Failed

- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors..
@cjcenizal cjcenizal removed the WIP Work in progress label Jul 23, 2018
@cjcenizal cjcenizal changed the title [WIP] Add rollupSearchStrategy Add rollupSearchStrategy Jul 23, 2018
Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Code LGTM! So excited for this. Great work!

@@ -71,14 +72,30 @@ export const defaultSearchStrategy = {
const searching = es.msearch({ body: serializedFetchParams });

return {
// Unwrap the responses object returned by the es client.
searching: searching.then(({ responses }) => responses),
// Munge data into shape expected by consumer.
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL 'munge'

$scope.$watch('vis.requestError', (requestError) => {
if (requestError && requestError.messsage) {
const { message } = requestError;
const isRollupError = message.includes('rollup');
Copy link
Contributor

Choose a reason for hiding this comment

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

when we fix this up on the next pass, let's remove rollup reference too! 🙂

}
}

// TODO: Temporarily automatically assign same timezone and interval as what's defined by
Copy link
Contributor

Choose a reason for hiding this comment

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

this will be handled by EditorConfig #20519
(just linking for prosperity!)

@cjcenizal cjcenizal merged commit 3be85a2 into elastic:feature/rollups Jul 23, 2018
@cjcenizal cjcenizal deleted the rollup-search-strategy branch July 23, 2018 23:01
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Jul 23, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
@elasticmachine
Copy link
Contributor

💔 Build Failed

jen-huang pushed a commit that referenced this pull request Jul 24, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
jen-huang pushed a commit that referenced this pull request Jul 31, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
jen-huang pushed a commit that referenced this pull request Aug 10, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Aug 17, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Aug 24, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit that referenced this pull request Sep 4, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
jen-huang pushed a commit that referenced this pull request Sep 7, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit that referenced this pull request Sep 18, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit that referenced this pull request Sep 19, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit that referenced this pull request Sep 28, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit that referenced this pull request Oct 2, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
cjcenizal added a commit that referenced this pull request Oct 4, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
jen-huang pushed a commit that referenced this pull request Oct 17, 2018
* Add /api/rollup/search endpoint and rollupSearchStrategy.
* Add SearchError for surfacing courier search errors.
- Use toastNotifications to surface errors in visualization editor.
- Add call-out react directive and use it to surface rollup errors in the visualization editor sidebar.
- Temporarily assign timezone and interval values from rollup job to the search to avoid errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants