- Errors on the application level were not correctly surfaced in the UI. This PR fixes it by combining "transport" stream errors and application errors in a callout above the analysis results table.
- This also fixes the problem where a partly populated results table would turn empty again when used with the error prop of EUI's table. We now keep the table on display an show the errors above it in the callout.
- Fixes API messages and loading state to always finish with 100% except when a user cancels the request.
- Fix to never apply loading={true} to the analysis table because it disables hovering events. To indicate loading we have the overall progress bar anyway.
- When the analysis returns no results, instead of an empty table and just the "no data" message, this now hides the table and displays an EuiEmptyPrompt.
Fixes the check to allow only data views with time fields for the Explain Log Rate Spikes UI. Previously the check was done on an outer component and didn't reach the component that would display an error message, the user ended up with an empty page. Instead of a non-working UI and an error message in a toast, this now hides the entire UI and just displays an error callout component.
- Fixes a race condition when loading document count stats for the histogram charts. Previously, data for the splitted histogram were loaded with to custom hooks in parallel which meant data in the chart could end up out of sync when transitioning from one state to the other.
- Fixes another race condition where stale data fetched via hovering would populate the chart late. This was fixed by adding abort signals to the data fetching hooks.
- Adds caching to the data fetched via hovering the analysis table rows.
* Save globally pinned filters and set merged query to handle empty strings
* Retain filters coming from other apps
* Fix same issues for aiops
* Fix tests
* Add named functions clearFiltersOnLeave
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Disables tooltips in mini histograms to avoid bug with sticky tooltips and to be in line with APM sparkline behavior.
- Fix to set mini histogram background to transparent so the chart background picks up the background of a hovered table row.
- Fix some hard coded values by using values provided by EUI.
- Fixes an issue where histograms were assigned to the wrong table rows.
- Support for loading indicator and empty chart state.
- Tweaks analysis table column widths.
- Adds an empty prompt when there's no current selection to describe the necessary click action and some general feature description.
- Adds an option to clear the current selection and start from scratch.
- Adds badges to the brush areas to label them as Baseline and Deviation.
- Adds EuiPanel as wrappers for the chart and table sections. The distinct sections make it easier to identify to which context an action like the analysis refresh button refers.
- Use dataView.getName() instead of dataView.title.
- Adds missing scss brought over from Data Visualizer to improve positioning of long Data View names.
* add support for saved search
* move analysis table and progress to separate component
* fix types
* ensure filters from saved search show up correctly
* add search bar with filters
* create application directory and utils directory
* incorporate cache fix and ensure search works
* move search above table and fix type errors
* refactor to minimize start bundle
* update branch with latest changes and fix types
* add comments to track duplicate code
- Extends the analysis API to return histogram data.
- Adds a column with MiniHistogram components to the analysis results table.
- Moves/consolidates fetchHistogramsForFields to @kbn/ml-agg-utils (also used in Data Visualizer and Data Grid Mini Histograms).
- So far fetchHistogramsForFields auto-identified the necessary interval and min/max. To be able to generate histogram data for the log rate spikes charts an options was added to use that information up front for the data to be fetched. This allows the buckets for the chart data for the overall (green bars) and the field/value-filtered (orange bars) histogram to have the exact same buckets.
* chore(NA): eslint rule for disallowing naked eslint-disable
* chore(NA): export new rule and update docs
* chore(NA): creation of rule in ts
* chore(NA): new corrected rule in ts
* refact(NA): remove old logic from older plugin
* docs(NA): update documentation
* docs(NA): update documentation
* docs(NA): update documentation
* refact(NA): include edge cases for better locating errors
* chore(NA): changed regex name
* docs(NA): correct name rule on docs
* refact(NA): use dedent in the template literals
* refact(NA): check for undefined
* fix(NA): introduces support for eslint-disable-line
* chore(NA): fix extra space
* test(NA): created more test cases
* chore(NA): rename plugin to eslint-plugin-disable
* docs(NA): update nav and operations landing page ids for eslint rule
* test(NA): use messageIds on test
* chore(NA): complete naked eslint disables with specific rules
* chore(NA): specific rules for a few naked eslint disable
* chore(NA): add focused eslint disable on big reindex_operation_with_large_error_message.ts file
* chore(NA): changes according PR feedback
* chore(NA): include specific eslint rules on latest naked eslint disable
* chore(NA): missing eslint disable specific rule
* fix(NA): remove comment for js annotator
* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts
* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts
* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Adds the DualBrush component to DocumentCountChart to allow the user to select WindowParameters for the explain log rate spikes analysis.
- VIEW_MODE is for now hard coded to brush. In a follow up we will allow a user to switch between zoom mode for navigation and brush mode for selection of WindowParameters.
- The auto-generation of WindowParameters has been removed from the wrapping code in the ML plugin.
- urlState related code has been moved from ExplainLogRateSpikes to ExplainLogRateSpikesWrapper.
- The analysis results table style has been changed to compressed.
* wip: create initial use full data and log spike table and histogram chart
* wip: adds timepicker and use full data complete functionality
* ensure time selectin persists in url
* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'
* add impact and score bar to table
* fix filename typo
* add lazy component wrapper, fix translation naming
* update type names
* remove duplicate code
* update error type
* rename overall stats hook to doccountstats hook
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Adds the code for the dual brush component for users to be able select log rate spikes in histogram charts.
For this PR a new package @kbn/aiops-components was created that also includes ProgressControls from @kbn/aiops-utils now. The reason for this is: The brush component includes code from d3 that cannot be imported on the server side which aiops-utils was also used for.
- Adds a check to aiops API endpoints to only allow requests with active platinum license.
- Adds integration tests for basic license where the endpoints should return permission denied.
- Improved error handling:
- Low level errors (like a non valid argument pushed to a stream) will now be logged to Kibana server's console, because the way HTTP streams work we cannot really emit a useful error to an already running stream to the client. So the stream will just abort but Kibana server will log an error.
- Higher level errors on the application level (like when we find out an index does not exist to run the analysis) will be pushed to the stream now as an error type action and we can update the UI accordingly. Note this PR only updates the API and corresponding tests to support this, the UI doesn't make use of it yet.
Updates the API endpoint "/internal/aiops/explain_log_rate_spikes" to work with real data instead of the dummy example.
The analysis now includes identifying field candidates and statistically significant field value pairs. Because there is no UI in place yet to allow a user to select custom time ranges for baseline and deviation, for now we fetch a date histogram of the selected index pattern and identify the parameters to get passed as WindowParameters automatically by picking the part of the date histogram with the highest doc count.
This PR is more about getting the API endpoint into shape and updates integration tests too. The UI code should be considered temporary. At the moment it just outputs the returned analysis state as raw JSON in a EUI code block.
This creates a response_stream plugin in the Kibana /examples section. The plugin demonstrates API endpoints that can stream data chunks with a single request with gzip/compression support. gzip-streams get decompressed natively by browsers. The plugin demonstrates two use cases to get started: Streaming a raw string as well as a more complex example that streams Redux-like actions to the client which update React state via useReducer().
This disables the UI and APIs for Explain log rate spikes in the ML plugin since it will not be part of 8.3. Once 8.3 has been branched off, we can reenable it in main. This also adds a check to the API integration tests to run the tests only when the hard coded feature flag is set to true.
Builds out UI/code boilerplate necessary before we start implementing the feature's own UI on a dedicated page.
- Updates navigation to bring up data view/saved search selection before moving on to the explain log spike rates page.
The bar chart race demo page was moved to the aiops/single_endpoint_streaming_demo url. It is kept in this PR so we have two different pages + API endpoints that use streaming. With this still in place it's easier to update the streaming code to be more generic and reusable.
- The url/page aiops/explain_log_rate_spikes has been added with some dummy request that slowly streams a data view's fields to the client. This page will host the actual UI to be brought over from the PoC in follow ups to this PR.
- The structure to embed aiops plugin pages in the ml plugin has been simplified. Instead of a lot of custom code to load the components at runtime in the aiops plugin itself, this now uses React lazy loading with Suspense, similar to how we load Vega charts in other places. We no longer initialize the aiops client side code during startup of the plugin itself and augment it, instead we statically import components and pass on props/contexts from the ml plugin.
- The code to handle streaming chunks on the client side in stream_fetch.ts/use_stream_fetch_reducer.ts has been improved to make better use of TS generics so for a given API endpoint it's able to return the appropriate coresponding return data type and only allows to use the supported reducer actions for that endpoint. Buffering client side actions has been tweaked to handle state updates more quickly if updates from the server are stalling.
Sets up the boilerplate code for the aiops plugin and adds a demo page within the ML app to demonstrate single API request data streaming from Kibana server to UI client.