Commit graph

29 commits

Author SHA1 Message Date
Walter Rafelsberger
455704e1fc
[ML] Explain Log Rate Spikes: Fix uncompressed streams and backpressure handling. (#142970) (#144396)
- Adds a flag for `compressResponse` and `flushFix` to the request body to be able to overrule compression settings inferred from headers.
- Updates the developer examples with a toggle to run requests with compression enabled or disabled.
- Adds support for backpressure handling for response streams.
- The backpressure update includes a fix where uncompressed streams would never start streaming to the client.
- The analysis endpoint for Explain Log Rate Spikes now includes a ping every 10 seconds to keep the stream alive.
- Integration tests were updated to test both uncompressed and compressed streaming.

(cherry picked from commit b38bbbcea3)
2022-11-02 03:50:27 -07:00
Kibana Machine
410d5e4bd6
[ML] Explain Log Rate Spikes: Fix loading state for grouping. (#141770) (#142445)
Fix loading state messages for grouping:
- Fixes the progress bar messages to include the grouping step.
- If progress stalls, it might look to the user like the analysis got stuck when there are steps like the grouping that take a longer time. This updates the progress bar to show an animated background as long as the analysis is running. When the analysis finishes or gets canceled the animated background gets disabled and shows a static background.

(cherry picked from commit 5203f1bcc8)

Co-authored-by: Walter Rafelsberger <walter.rafelsberger@elastic.co>
2022-10-03 02:30:35 -07:00
Kibana Machine
889c033bd4
[ML] Explain Log Rate Spikes: ensure brush style is applied on brush creation (#141545) (#141667)
* ensure brush style is applied on brush creation

* [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>
(cherry picked from commit 2e91c672f0)

Co-authored-by: Melissa Alvarez <melissa.alvarez@elastic.co>
2022-09-23 09:25:02 -07:00
Walter Rafelsberger
1598523b4f
[ML] Explain Log Rate Spikes: Add mini histograms to grouped results table. (#141065)
- Adds mini histograms to grouped results table.
- Fixes row expansion issue where expanded row could show up under wrong row.
2022-09-20 21:23:12 +02:00
Walter Rafelsberger
706d3defdd
[ML] Explain Log Rate Spikes: Fix grouping edge cases. (#140891)
- Change point groups might miss individual change points that were not returned by the `frequent_items` agg as part of groups. This PR now adds each missing one as an individual additional group.
- Only return groups if there's at least one group with more than one item, otherwise fall back to basic table with significant terms.
- Changes the UI behaviour to show the regular table by default and the grouping switch set to off.
- Adds `p-value` column to grouped table and defaults to sorting by that column similar to table with indidivual items.
2022-09-20 17:37:26 +02:00
Walter Rafelsberger
e3664b112a
[ML] Explain Log Rate Spikes: Fix stream flushing. (#140506)
This is a temporary fix for response streaming. The current cloud environment buffers each stream with chunks up to 4KB. To force trigger flushing, we send along a 4KB dummy payload to trigger an update. This fixes a stale loading bar for Explain Log Rate Spikes. Once the cloud environment's proxy has been updated to support flushing below the 4KB threshold, we can remove this fix again.
2022-09-15 11:37:49 +02:00
Walter Rafelsberger
5ba23e432d
[ML] Explain Log Rate Spikes: Group results API. (#140683)
Extends the `/internal/aiops/explain_log_rate_spikes` with an option to extend the analysis and summarize significant field/value pairs into groups using the frequent_items aggregation.
2022-09-14 18:26:15 +02:00
Walter Rafelsberger
e490ca9e61
[ML] Fix package imports. (#140488)
Previously, some types were not available yet in packages that needed to imported via kibana-core. Since they are now available, this PR replaces our own temporary types with the correct imports.
2022-09-13 10:48:25 +02:00
Walter Rafelsberger
6a2fa9f4b4
[ML] Explain Log Rate Spikes: Improve streaming headers for certain proxy configs. (#139637)
Updates response headers to make response streaming work with certain proxy configurations.
2022-09-12 10:13:36 +02:00
Spencer
32491462a9
add kibana.jsonc files to existing packages (#138965)
* [packages] add kibana.jsonc files

* auto-migrate to kibana.jsonc

* support interactive pkg id selection too

* remove old codeowners entry

* skip codeowners generation when .github/CODEOWNERS doesn't exist

* fall back to format validation if user is offline

* update question style

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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-08 13:31:57 -07:00
Tiago Costa
1cbf83f73c
chore(NA): remove src folder requirement from packages (part 2) (#138476)
* 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

* chore(NA): first attempt to complete removal of src folder on a small group of pkgs

* Revert "chore(NA): first attempt to complete removal of src folder on a small group of pkgs"

This reverts commit b6f34b7530.

* chore(NA): remove src folder requirement from xpack pkgs

* chore(NA): remove src folder from analytics pkgs

* chore(NA): remove src folder from home pkgs

* chore(NA): remove src folder from shared_ux pkgs

* fix(NA): remove missing src folder inputs on sharedux pkg

* chore(NA): remove src folder from kbn-a* pkgs

* chore(NA): remove src folder from kbn-b* pkgs

* chore(NA): remove src folder from kbn-c* pkgs

* chore(NA): correct exclude pattern for each changed pkg

* chore(NA): remove src folder from kbn-y* pkgs

* chore(NA): remove src folder from kbn-e* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-h** pkgs

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

* Revert "chore(NA): remove src folder from kbn-h** pkgs"

This reverts commit dcdf72bcc1.

* fix(NA): grammar location

* test(NA): fix tests for kbn/config-schema

* test(NA): fix tests for kbn/config-schema

* chore(NA): multiple errors fixed

* chore(NA): remove kuery grammar fix

* fix(NA): @kbn/ace imports

* fix(NA): grammar location

* fix(NA): add missing files to tsconfigs

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

* chore(NA): complete tsconfigs

* Revert "chore(NA): complete tsconfigs"

This reverts commit f48c616864.

* chore(NA): remove src folder from kbn-core* pkgs

* chore(NA): remove src folder from kbn-u* pkgs

* chore(NA): remove src folder from kbn-ui-shared-deps* pkgs

* chore(NA): fix problems on core pkgs

* chore(NA): fix problems on core pkgs

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

* fix(NA): shared_built_assets correct location'

* test(NA): update @kbn/optimizer integration snapshots

* chore(NA): remove src folder from kbn-t* p1 pkgs

* chore(NA): remove src folder from kbn-t* p2 pkgs

* chore(NA): update rootDir on utility types pkg

* chore(NA): include missing files on @kbn/test

* chore(NA): include missing files on @kbn/test

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): fix eslint

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): remove exclusion for mocks folde on @kbn/test

* fix(NA): several imports from target_node

* fix(NA): @kbn/test mocha and jest types clash

* chore(NA): remove src folder from kbn-storybook pkg

* chore(NA): remove src folder from kbn-stdio-dev-helpers pkg

* chore(NA): remove src folder from kbn-std pkg

* chore(NA): remove src folder from kbn-sort-pkg-json pkg

* chore(NA): remove src folder from kbn-some-dev-log and kbn-shared-ux-utility pkgs

* chore(NA): remove src folder from kbn-ux-storybook pkg

* chore(NA): remove src folder from kbn-shared-ux-services pkg

* chore(NA): remove src folder from kbn-shared-ux-components pkg

* chore(NA): remove src folder from kbn-shared-svg pkg

* chore(NA): remove src folder from kbn-server-http-tools pkg

* chore(NA): remove src folder from kbn-securitysolution-* pkgs

* chore(NA): remove src folder from kbn-r-* pkgs

* chore(NA): remove src folder from kbn-p* pkgs

* chore(NA): remove src folder from kbn-o* pkgs

* chore(NA): remove src folder from kbn-m* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-io-ts-utils* pkgs

* chore(NA): remove src folder from kbn-* pkgs except a few

* chore(NA): update @kbn/generate

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): remove src folder from kbn-monaco pkg

* chore(NA): remove src folder from kbn-interpreter pkg

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): update every require for target_*/src

* chore(NA): remover src folder from @kbn/handlebars

* fix(NA): license for @kbn/handlebars

* chore(NA): copy templates as part of the jsts_transpiler macro for @kbn/storybook

* chore(NA): update handlebars

* fix(NA): @kbn/plugin-generator import paths

* fix(NA): bundle sizes

* fix(NA): web bundle for @kbn/i18n-react

* Revert "fix(NA): bundle sizes"

This reverts commit 8aefe84fbc.

* Revert "Revert "fix(NA): bundle sizes""

This reverts commit e9d87d72a4.

* fix(NA): @kbn/docs-utils index.ts path expectation

* chore(NA): merge and solve conflicts with main

* fix(NA): relative import to index

* chore(NA): merge and solve conflicts with main

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

* chore(NA): apply eslint fix

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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-30 15:57:35 +01:00
Dima Arnautov
9c3ed2895f
[ML] Attach the anomaly swim lane embeddable to Case (#138994)
* ceses wip

* cases flyout and modal

* add theme provider

* render embeddable component

* update context menu

* basic embeddable props description

* update icons

* set absolute time range

* get permissions

* update actions compatibility

* add path to tsconfig

* check permission for attach action

* refactor

* use fieldFormats for dates

* functional tests

* revert test subj

* add generalCases

* hide panel on action click

* improve assertion

* asserting case content

* wip asserting swim lane content in Cases

* unique id for embeddable, fix types

* assert embeddable id and swim lane

* resolve nit comments
2022-08-25 13:14:24 +02:00
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
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