Commit graph

869 commits

Author SHA1 Message Date
Walter Rafelsberger
148b48f905
[ML] Explain Log Rate Spikes: Extended Functional tests. (#138661)
Adds functional tests that use the histogram brushes and run an analysis.
2022-08-17 17:18:35 +02:00
Walter Rafelsberger
3ff5fb2bec
[ML] Explain Log Rate Spikes: Fix stale brush props. (#138272)
Fixes stale props that would cause a broken brush update when the overall time range selection changes.
2022-08-10 17:41:40 +02:00
Jonathan Budzenski
b3a38c4137 Revert "[Lens] Move custom chart icons into lens package (#138101)"
This reverts commit d89b2cb903.
2022-08-09 09:30:44 -05:00
Alexey Antonov
d89b2cb903
[Lens] Move custom chart icons into lens package (#138101)
* [Lens] Move custom chart icons into lens package

Closes #135230

* add storybook

* fix merge conflicts

* [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest'

* clenaup

* add region_map icon into package

* fix styles

* Update README.md

* fix ci

* try to fix CI

* fix PR comments

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* RegionMap -> LensIconRegionMap

* lensIcons -> lens_icons

* move to x-pack packages

* [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest'

* move to x-pack/packages/lens/icons

* fix jest

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-09 17:15:12 +03:00
Tiago Costa
df8b62aa98
chore(NA): allow packages to not have an obligation for a src folder on packages (#138038)
* refact(NA): apply root_input_dir=src to each already created pkg

* refact(NA): update package generator

* fix(NA): correctly use rootDir

* fix(NA): use root input dir on latest introduced pkgs for jsts_transpiler macro

* chore(NA): merge with main

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-08 15:54:05 +01:00
Walter Rafelsberger
9512635a7d
[ML] Explain log rate spikes: Fix brush issues. (#138113)
- Fixes overlapping brush badges.
- Adds missing tooltips to brush badges.
2022-08-04 17:08:32 +02:00
Walter Rafelsberger
70efbf0ea3
[ML] Explain Log Rate Spikes: Fix error handling. (#137947)
- 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.
2022-08-04 15:23:36 +02:00
Melissa Alvarez
b17579afa3
[ML] Explain log rate spikes: Fix data out of date when brush selection changes (#137791)
* update run analysis button content when selection changges

* fix brush overlap causing endless rerender

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix resize triggering rerun analysis prompt

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* add comments to getSnappedWindowParameters function

* use memo instead of using component state

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix eslint error and simplify usememo callback

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-03 12:11:15 -04:00
Melissa Alvarez
4027e977b0
[ML] Explain log rate spikes: adds table sorting (#137110)
* add sorting for table

* update analysis refresh button copy

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* add info tooltips for p-value, log rate, and impact columns

* update tooltip copy

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* update types and simplify tooltip content

* make sort case insensitive

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-07-26 14:08:38 -04:00
Walter Rafelsberger
97c0b32159
[ML] Explain log rate spikes: Improve analysis workflow. (#137192)
- 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.
2022-07-26 18:54:42 +02:00
Walter Rafelsberger
092fb354ec
[ML] Explain log rate spikes: Add field histograms to analysis result. (#136295)
- 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.
2022-07-20 11:44:19 +02:00
Walter Rafelsberger
b65f0bd122
[ML] Add TODO comments about possible code consolidation. (#136181) 2022-07-12 13:15:28 +02:00
Quynh Nguyen
6b51010141
[ML] Transforms: Adds per-transform setting for num_failure_retries to creation wizard and edit flyout and authorization info (#135486)
* [ML] Add optional num_failure_retries setting in creation wizard and edit flyout

* [ML] Fix logic for input validation

* Fix types & i18n

* Change to integerRangeMinus1To100

* Fix clone

* Fix test

* Update text

* [ML] Add functional tests

* [ML] Add functional tests for editting

* [ML] Update translations

* [ML] Surface num failure retries to stats

* [ML] Add authorization info

* [ML] Fix extra period

* [ML] Move numberValidator to its own package

* [ML] Add tests for cloning

* [ML] Update logic + add unit tests

* [ML] Fix expected value
2022-07-08 07:57:59 -07:00
Spencer
a3b2757e4e
[type-summarizer] reimplement for broader support (#135163)
* [type-summarizer] reimplement for broader support

* Enable sourceMaps in all packages

* include naming collision in summarizePackage test

* fix readmes

* remove unnecessary transient dependency

* remove code that was commented out

* remove outdated todo comment

* ensure errors triggered by untyped-exports are ligible

* remove unused import

* break out snippet generation from AstIndexer

* refactor several massive files into smaller pieces and add more inline docs

* fix typos

* update jest snapshots

* add sections to readme that points people to the useful parts of the source code along with a high-level overview of how the type-summarizer works

* remove --dump flag, it doesn't work

* use decName instead of calling names.get a second time

* include `export` as invalid name
2022-07-06 13:48:45 -05:00
Walter Rafelsberger
04907932c4
[ML] Explain log rate spikes: Add DualBrush component. (#135318)
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.
2022-07-06 14:08:05 +02:00
Walter Rafelsberger
d50434ed7b
[ML] Explain log rate spikes: Adds API license check. (#135431)
- 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.
2022-06-30 15:32:31 +02:00
Walter Rafelsberger
a0f69e0e43
[ML] Explain log rate spikes: Analysis API endpoint. (#135058)
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.
2022-06-28 13:26:09 +02:00
Walter Rafelsberger
8c94def73e
[ML] Move aiops-utils package to x-pack/packages/ml. (#134985)
When we created the `aiops-utils` package originally, we were not aware that packages could also live within `x-pack`. Since `aiops` is a platinum feature and maintained by the ML team, this moves the package from `/packages` to `/x-pack/packages/ml`. The license header of the package files now match the `aiops` plugin again.
2022-06-24 19:37:02 +02:00
Walter Rafelsberger
adbd6a5fb8
[ML] @kbn/ml-agg-utils, @kbn/ml-is-populated-object, @kbn/ml-string-hash packages. (#132963)
Moves some ML utility code to packages.

- @kbn/ml-agg-utils contains multiple utilities used in combination related to building aggregations.
- @kbn/ml-is-populated-object contains the isPopulatedObject() utility function used across several plugins.
- @kbn/ml-string-hash contains the stringHash() utility function used across several plugins.
2022-06-23 10:38:23 +02:00