Commit graph

278 commits

Author SHA1 Message Date
Dima Arnautov
917d9187fa
[ML] Enable Change Point Detection UI (#146991)
## Summary

Enables [Change Point Detection UI
](https://github.com/elastic/kibana/pull/144093)
2022-12-05 06:29:30 -07:00
Spencer
2e314db2ce
Wrap rison-node to improve types (#146649)
@maximpn brought up the issues caused by the types required by the
rison-node package, which attempted to communicate that "encoded values
must be primitive values, or recursive arrays/object of primitive
values". This isn't actually expressible in TypeScript, which lead to
many instances of `rison.encode(value as unknown as RisonValue)` which
is useless. Additionally, the rison-node library actually supports any
value and will either produce valid rison or `undefined` for that value.

To address this I'm adding a wrapper function which accepts `any` and
returns a `string`. If rison-node is totally unable to produce any rison
for the value (because the value is `undefined` or some other type like
Symbol or BigInt) the `encode()` function will throw. If you're
accepting arbitrary input you can use the `encodeUnknown()` function,
which will return a string or undefined, if the value you provided has
zero rison representation.

Like JSON.stringify() any non-circular primitive, object, or array can
be encoded with either function. If the values within those objects are
not encodable (functions, RegExps, etc) then they will be skipped. Any
object/array with the `toJSON()` method will be converted to JSON first,
and if the prototype of the object has the `encode_rison()` method it
will be used to convert he value into rison.

The changes in this PR are mostly updating usage of rison-node to use
`@kbn/rison` (which is also enforced by eslint). There are also several
changes which remove unnecessary casting.
2022-12-01 08:33:56 -07:00
Pete Harverson
3a92e247a6
[ML] Fix caret direction for expanded state of table rows (#146451)
## Summary

Fixes the icons used to indicate the collapsed / expanded state of table
rows in the Data Frame Analytics, Trained Models and Explain Log Rate
Spikes pages in the ML plugin, and the Transforms list page. They are
now consistent with other tables, with a **right caret** to indicate a
**closed section** and a **down caret** for **open sections**.

### Data frame analytics jobs list
<img width="689" alt="image"
src="https://user-images.githubusercontent.com/7405507/204346940-e56436e1-2e21-4f4d-a618-2b243438a55f.png">

### Data frame analytics results
<img width="730" alt="image"
src="https://user-images.githubusercontent.com/7405507/204346993-32c600d1-f94c-4cb3-8740-e5344ecd6b4e.png">

### Trained models list
<img width="788" alt="image"
src="https://user-images.githubusercontent.com/7405507/204347063-2a50ac16-456c-4ca0-a446-b8535f5ba5cb.png">

### Nodes list
<img width="506" alt="image"
src="https://user-images.githubusercontent.com/7405507/204347215-970a07fe-062c-4c6f-bdfc-ed0f473e9681.png">

### Explain Log Rate Spikes grouped results
<img width="809" alt="image"
src="https://user-images.githubusercontent.com/7405507/204347302-10975598-5e88-42ac-a648-eae64976ed84.png">

### Transform management
<img width="1063" alt="image"
src="https://user-images.githubusercontent.com/7405507/204347393-124a366e-f5a9-44ba-8bfc-94788f334ba9.png">



Fixes #142898
2022-11-29 11:58:23 +00:00
Melissa Alvarez
95dd368932
[ML] Explain Log Rate Spikes: improve the display of large groups (#145609)
## Summary

Related meta issue: https://github.com/elastic/kibana/issues/142626

Improves the display of large groups by limiting the badges displayed to
10 and updates the +more badge.

<img width="1066" alt="image (2)"
src="https://user-images.githubusercontent.com/6446462/202530438-210c7005-feb6-4e76-9bbd-48eb6b26293e.png">


### Checklist

Delete any items that are not applicable to this PR.
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-21 13:21:14 -07:00
Constance
c408cebb12
Upgrade EUI to v70.2.4 (#144845)
## Summary
`eui@67.1.8`  `eui@70.2.2`

⚠️ Note: This upgrade contains breaking changes to `EuiFlexGroup` and
`EuiFlexGrid`, primarily around switching margins and negative margins
to `gap`. Please do a quick QA pass of your app to scan for any issues.
We're happy to help resolve minor fixes, or potentially follow up after
PR merges. You can find us over in #eui!

## [`70.2.4`](https://github.com/elastic/eui/tree/v70.2.4)

**Bug fixes**

- Fixed visual bug in nested `EuiFlexGroup`s, where the parent
`EuiFlexGroup` is responsive but a child `EuiFlexGroup` is not
([#6381](https://github.com/elastic/eui/pull/6381))

## [`70.2.3`](https://github.com/elastic/eui/tree/v70.2.3)

**Bug fixes**

- Fixed incorrect margins in `EuiSuperDatePicker` caused by `EuiFlex`
CSS gap change ([#6380](https://github.com/elastic/eui/pull/6380))

## [`70.2.2`](https://github.com/elastic/eui/tree/v70.2.2)

- `EuiButton` now accepts `minWidth={false}`
([#6373](https://github.com/elastic/eui/pull/6373))

**Bug fixes**

- `EuiButton` no longer outputs unnecessary inline styles for
`minWidth={0}` or `minWidth={false}`
([#6373](https://github.com/elastic/eui/pull/6373))
- `EuiFacetButton` no longer reports type issues when passing props
accepted by `EuiButton`
([#6373](https://github.com/elastic/eui/pull/6373))
- Fixed the shadow sizes of `.eui-yScrollWithShadows` and
`.eui-xScrollWithShadows`
([#6374](https://github.com/elastic/eui/pull/6374))


## [`70.2.1`](https://github.com/elastic/eui/tree/v70.2.1)

**Bug fixes**

- Re-fixed `EuiPageSection` not correctly merging `contentProps.css`
([#6365](https://github.com/elastic/eui/pull/6365))
- Fixed `EuiTab` not defaulting to size `m`
([#6366](https://github.com/elastic/eui/pull/6366))

## [`70.2.0`](https://github.com/elastic/eui/tree/v70.2.0)

- Added a keyboard shortcuts popover to `EuiDataGrid`'s toolbar. This
can be visually hidden via `toolbarVisibility.showKeyboardShortcuts`,
but will always remain accessible to keyboard and screen reader users.
([#6036](https://github.com/elastic/eui/pull/6036))
- `EuiScreenReaderOnly`'s `showOnFocus` prop now also shows on focus
within its children ([#6036](https://github.com/elastic/eui/pull/6036))
- Added `onFocus` prop callback to `EuiSuperDatePicker`
([#6320](https://github.com/elastic/eui/pull/6320))

**Bug fixes**

- Fixed `EuiSelectable` to ensure the full options list is re-displayed
when the search bar is controlled and cleared using `searchProps.value`
([#6317](https://github.com/elastic/eui/pull/6317))
- Fixed incorrect padding on `xl`-sized `EuiTabs`
([#6336](https://github.com/elastic/eui/pull/6336))
- Fixed `EuiCard` not correctly merging `css` on its child `icon`s
([#6341](https://github.com/elastic/eui/pull/6341))
- Fixed `EuiCheckableCard` not setting `css` on the correct DOM node
([#6341](https://github.com/elastic/eui/pull/6341))
- Fixed a webkit rendering issue with `EuiModal`s containing
`EuiBasicTable`s tall enough to scroll
([#6343](https://github.com/elastic/eui/pull/6343))
- Fixed bug in `to_initials` that truncates custom initials
([#6346](https://github.com/elastic/eui/pull/6346))
- Fix bug in `EuiCard` where layout breaks when `horizontal` and
`selectable` are both passed
([#6348](https://github.com/elastic/eui/pull/6348))

## [`70.1.0`](https://github.com/elastic/eui/tree/v70.1.0)

- Added the `hint` prop to the `<EuiSearchBar />`. This prop lets the
consumer render a hint below the search bar that will be displayed on
focus. ([#6319](https://github.com/elastic/eui/pull/6319))
- Added the `hasDragDrop` prop to `EuiPopover`. Use this prop if your
popover contains `EuiDragDropContext`.
([#6329](https://github.com/elastic/eui/pull/6329))

**Bug fixes**

- Fixed `EuiButton`'s cursor style when the button is disabled
([#6323](https://github.com/elastic/eui/pull/6323))
- Fixed `EuiPageTemplate` not recognizing child
`EuiPageSidebar`s/`EuiPageTemplate.Sidebar`s with `css` props
([#6324](https://github.com/elastic/eui/pull/6324))
- Fixed `EuiBetaBadge` to always respect its `anchorProps` values,
including when there is no tooltip content
([#6326](https://github.com/elastic/eui/pull/6326))
- Temporarily patched `EuiModal` to not cause scroll-jumping issues on
modal open ([#6327](https://github.com/elastic/eui/pull/6327))
- Fixed buggy drag & drop behavior within `EuiDataGrid`'s columns &
sorting toolbar popovers
([#6329](https://github.com/elastic/eui/pull/6329))
- Fixed `EuiButton` not correctly passing `textProps` for children
inside fragments or i18n components
([#6332](https://github.com/elastic/eui/pull/6332))
- Fixed `EuiButton` not correctly respecting `minWidth={0}`
([#6332](https://github.com/elastic/eui/pull/6332))

**CSS-in-JS conversions**

- Converted `EuiTabs` to Emotion
([#6311](https://github.com/elastic/eui/pull/6311))

## [`70.0.0`](https://github.com/elastic/eui/tree/v70.0.0)

- Added the `enabled` option to the `<EuiInMemoryTable />`
`executeQueryOptions` prop. This option prevents the Query from being
executed when controlled by the consumer.
([#6284](https://github.com/elastic/eui/pull/6284))

**Bug fixes**

- Fixed `EuiOverlayMask` to set a
`[data-relative-to-header=above|below]` attribute to replace the
`--aboveHeader` and `--belowHeader` classNames removed in its Emotion
conversion ([#6289](https://github.com/elastic/eui/pull/6289))
- Fixed `EuiHeader` CSS using removed `EuiOverlayMask` class modifiers
([#6293](https://github.com/elastic/eui/pull/6293))
- Fixed `EuiToolTip` not respecting reduced motion preferences
([#6295](https://github.com/elastic/eui/pull/6295))
- Fixed a bug with `EuiTour` where passing any `panelProps` would cause
the beacon to disappear
([#6298](https://github.com/elastic/eui/pull/6298))

**Breaking changes**

- `@emotion/css` is now a required peer dependency, alongside
`@emotion/react` ([#6288](https://github.com/elastic/eui/pull/6288))
- `@emotion/cache` is no longer required peer dependency, although your
project must still use it if setting custom cache/injection locations
([#6288](https://github.com/elastic/eui/pull/6288))

**CSS-in-JS conversions**

- Converted `EuiCode` and `EuiCodeBlock` to Emotion; Removed
`euiCodeSyntaxTokens` Sass mixin and `$euiCodeBlockPaddingModifiers`;
([#6263](https://github.com/elastic/eui/pull/6263))
- Converted `EuiResizableContainer` and `EuiResizablePanel` to Emotion
([#6287](https://github.com/elastic/eui/pull/6287))

## [`69.0.0`](https://github.com/elastic/eui/tree/v69.0.0)

- Added support for `fullWidth` prop on EuiForm, which will be the
default for all rows/controls within
([#6229](https://github.com/elastic/eui/pull/6229))
- Added support for `onResizeStart` and `onResizeEnd` callbacks to
`EuiResizableContainer`
([#6236](https://github.com/elastic/eui/pull/6236))
- Added optional case sensitive option matching to `EuiComboBox` with
the `isCaseSensitive` prop
([#6268](https://github.com/elastic/eui/pull/6268))
- `EuiFlexItem` now supports `grow={0}`
([#6270](https://github.com/elastic/eui/pull/6270))
- Added the `alignItems` prop to `EuiFlexGrid`
([#6281](https://github.com/elastic/eui/pull/6281))
- Added `filter`, `filterExclude`, `filterIgnore`, `filterInclude`,
`indexTemporary`, `infinity`, `sortAscending`, and `sortDescending`
glyphs to `EuiIcon` ([#6282](https://github.com/elastic/eui/pull/6282))

**Bug fixes**

- Fixed `EuiTextProps` to show the `color` type option `inherit` as
default ([#6267](https://github.com/elastic/eui/pull/6267))
- `EuiFlexGroup` now correctly respects `gutterSize` when responsive
([#6270](https://github.com/elastic/eui/pull/6270))
- Fixed the last breadcrumb in `EuiBreadcrumbs`'s `breadcrumbs` array
not respecting `truncate` overrides
([#6280](https://github.com/elastic/eui/pull/6280))

**Breaking changes**

- `EuiFlexGrid` no longer supports `columns={0}`. Use `EuiFlexGroup`
instead for normal flex display
([#6270](https://github.com/elastic/eui/pull/6270))
- `EuiFlexGrid` now uses modern `display: grid` CSS
([#6270](https://github.com/elastic/eui/pull/6270))
- `EuiFlexGroup`, `EuiFlexGrid`, and `EuiFlexItem` now use modern `gap`
CSS instead of margins and negative margins
([#6270](https://github.com/elastic/eui/pull/6270))
- `EuiFlexGroup` no longer applies responsive styles to `column` or
`columnReverse` directions
([#6270](https://github.com/elastic/eui/pull/6270))

**CSS-in-JS conversions**

- Converted `EuiFlexGroup`, `EuiFlexGrid`, and `EuiFlexItem` to Emotion
([#6270](https://github.com/elastic/eui/pull/6270))

## [`68.0.0`](https://github.com/elastic/eui/tree/v68.0.0)

- Added `beta` glyph to `EuiIcon`
([#6250](https://github.com/elastic/eui/pull/6250))
- Added `launch` and `spaces` glyphs to `EuiIcon`
([#6260](https://github.com/elastic/eui/pull/6260))
- Added the `fallbackDestination` prop to `EuiSkipLink`, which accepts a
string of query selectors to fall back to if the `destinationId` does
not have a valid target. Defaults to `main`
([#6261](https://github.com/elastic/eui/pull/6261))
- `EuiSkipLink` is now always an `a` tag to ensure that it is always
placed within screen reader link menus.
([#6261](https://github.com/elastic/eui/pull/6261))

**Bug fixes**

- Fixed `EuiSuperDatePicker` not correctly merging passed `className`s
([#6253](https://github.com/elastic/eui/pull/6253))
- Fixed `EuiColorStops` not correctly merging in passed
`data-test-subj`s, `style`s, or `...rest`
([#6255](https://github.com/elastic/eui/pull/6255))
- Fixed `EuiResizablePanel` incorrectly passing `style` to the wrapper
instead of the panel. Use `wrapperProps.style` to pass styles to the
wrapper. ([#6255](https://github.com/elastic/eui/pull/6255))
- Fixed custom `onClick`s passed to `EuiSkipLink` overriding
`overrideLinkBehavior`
([#6261](https://github.com/elastic/eui/pull/6261))

**Breaking changes**

- Removed `inherit` and `ghost` color from `EuiListGroupItem`
([#6207](https://github.com/elastic/eui/pull/6207))
- Changed default color to `text` instead of `inherit`
([#6207](https://github.com/elastic/eui/pull/6207))

**CSS-in-JS conversions**

- Converted `EuiListGroup` and `EuiListGroupItem` to Emotion; Removed
`$euiListGroupGutterTypes`, `$euiListGroupItemColorTypes` and
`$euiListGroupItemSizeTypes`;
([#6207](https://github.com/elastic/eui/pull/6207))
- Converted `EuiBadgeGroup` to Emotion
([#6258](https://github.com/elastic/eui/pull/6258))
- Converted `EuiBetaBadge` to Emotion
([#6258](https://github.com/elastic/eui/pull/6258))
- Converted `EuiNotificationBadge` to Emotion
([#6258](https://github.com/elastic/eui/pull/6258))

Co-authored-by: Elizabet Oliveira <elizabet.oliveira@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-18 14:21:28 -06:00
Walter Rafelsberger
86efac3632
[ML] Explain Log Rate Spikes: Use seed for random sampler agg. (#145088)
- Moves sample probability calculation to util `getSampleProbability()`
- Adds a seed to random sampler aggs to get deterministic results.
2022-11-16 14:33:40 +01:00
Dima Arnautov
3789ba31b9
[ML] Feature flag to disable Change Point Detection UI (#145285)
## Summary

Feature flag to hide [Change Point Detection
](https://github.com/elastic/kibana/pull/144093)
2022-11-15 11:52:12 -07:00
Dima Arnautov
3e22323e00
[ML] Change Point Detection (#144093)
## Summary

Adds a Change point detection page in the AIOps labs.

_Note:_ 
This page will be hidden under the hardcoded feature flag for 8.6. 

<img width="1775" alt="image"
src="https://user-images.githubusercontent.com/5236598/199506277-f0d71104-3098-4e15-a697-35f5eec5c110.png">

### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2022-11-15 18:47:27 +01:00
Walter Rafelsberger
1d511a439d
[ML] Explain Log Rate Spikes: Allow to continue failed stream. (#143301)
The analysis can be long running and in cases can time out depending on
server/proxy settings. This update allows a user to try to continue the
analysis if it failed half way through.
2022-11-10 09:03:44 +01:00
Dmitry Tomashevich
a9162f7481
[Discover] Enable esQuery alert for adhoc data views (#140885)
## Summary

Closes #142514 #142389

This PR does the following: 
- Enables to create `esQuery` (in KQL or Lucene mode) using adhoc data
views from discover and management pages
- Adds `explore matching indices` button to data view picker in alert
flyout
- Adding adhoc data views from alert flyout should propage them to a
main discover picker


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))

Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
2022-11-09 18:55:34 +03:00
Walter Rafelsberger
80bda1a336
[ML] Explain Log Rate Spikes: Apply random sampling to histogram aggregations. (#144627)
Adds random sampling as an option to `fetchFieldHistograms()`. Since this already supported normal sampling, this also adds a check if only one of the two options is used. Pending a future update we might remove support for normal sampling in a follow up. The Explain Log Rate Spikes analysis makes use of the new option and applies random sampling for the mini histogram data it fetches.
2022-11-08 17:25:36 +01:00
Walter Rafelsberger
4b617042f3
[ML] Explain Log Rate Spikes: Replace chunks of queries with concurrent queue. (#144220)
The queries for p-values and histograms were done in chunks of 10 parallel queries. The drawback with this approach was that if just one of these 10 queries was a lot slower, we'd still have to wait for it to finish before we could start the next chunk.  This PR replaces the chunking approach with an async concurrent queue of up to 10 queries. The difference is that as soon as the first of the 10 first queries finishes, we can start another query and don't have to wait for the slower ones to finish.

For this PR the `async` library is added to `package.json`, however it's not a completely new library being added since it was already used as a dependency of other packages we use in Kibana.
2022-11-04 16:19:08 +01:00
Walter Rafelsberger
2594349660
[ML] Explain Log Rate Spikes: Fix applying overall params to histogram queries. (#144219)
Applying the overall params like the time range to the histogram queries was missing. This fixes it by creating getHistogramQuery that can be applied when fetching the histogram for overall data, individual field/value histograms and group histograms.
2022-11-03 10:43:44 +01:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Walter Rafelsberger
73867722fc
[ML] Explain Log Rate Spikes: Apply sampling to p-value aggregations. (#143977)
Renames `fetchFieldCandidates()` to `fetchIndexInfo()` which now returns total document count and sampling probability in addition to field candidates. Previously sampling probability was only determined within the `frequent_items` fetcher. This refactor makes it reusable for other queries and we can apply it to the `p-value` aggregations. Adding it to fetching the histogram data will be done in another follow up.
2022-10-28 11:23:16 +02:00
Walter Rafelsberger
0092f0ac53
[ML] Explain Log Rate Spikes: Limit fields for frequent_items agg. (#143974)
Limits the fields we pass on to the frequent_items aggregation to 15. This is a trade off between speed and quality of the grouping result. The amount of fields we pass on to the agg grow the time it takes to get frequent items more than linearly and we risk timeouts with more fields.
2022-10-27 14:35:33 +02:00
Walter Rafelsberger
df9dbcd630
[ML] Explain Log Rate Spikes: Make use of abort signal for ES queries. (#143683)
So far we passed on the abort signal from the client to possibly cancel the analysis, but the signal was not passed on to the ES queries to cancel those. That means the analysis could be cancelled after each step but it did not cancel ES queries that were already running. This PR takes the already existing abort signal and passes it on to all ES queries.

This surfaced an issue with running too many queries in parallel: We didn't have a limit so far when fetching the histogram data. With using the abort signals, Kibana would report a warning if more than 10 queries were run at once. The PR updates fetching histogram data to also do it in chunks of 10 queries like we already do for the p-value aggregation. So the larger bulk of the file diff is the result of wrapping the histogram queries inside a for of to iterate over the chunks of queries.
2022-10-25 18:02:44 +02:00
Walter Rafelsberger
51ec72488a
Call p-value aggs in parallel. (#143722)
In the analysis part we created chunks of 10 calls for the p-value aggregations, but individual calls of these chunks were then still called one after the other. This PR changes the behaviour to run calls for each chunk in parallel.
2022-10-25 11:08:49 +02:00
Walter Rafelsberger
d556450795
[ML] Explain Log Rate Spikes: Wrap analysis in try/catch block.
This wraps the analysis part in a try/catch block. We had individual try/catch blocks already to handle ES queries. Because the analysis is run async, if another error happens it would trigger an unresolved promise error and could crash Kibana server. Adding this additional try/catch block avoids this.
2022-10-20 15:05:44 +02:00
Matthew Kime
a921696fbe
use getIndexPattern instead of title (#143686) 2022-10-20 07:27:40 -05:00
Dima Arnautov
f61dec4c3d
[ML] Fix date picker for the Log pattern analysis (#143684)
* url state provider

* update url state provider for explain_log_rate_spikes_app_state.tsx
2022-10-20 02:41:35 -07:00
Melissa Alvarez
253ed9c398
[ML] Explain Log Rate Spikes: fix chart showing as empty when filter matches field/value pair in hovered row (#142693)
* fix chart showing as empty when filter matches field/value pair in hovered row

* use both overall and split buckets to get timerange

* always pass along split stats as they are up to date

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-18 11:43:40 -06:00
Walter Rafelsberger
b38bbbcea3
[ML] Explain Log Rate Spikes: Fix uncompressed streams and backpressure handling. (#142970)
- 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.
2022-10-14 15:30:34 +02:00
Melissa Alvarez
ca04402e83
[ML] Explain Log Rate Spikes: update more groups badge for clarity (#142793)
* update more groups badge for clarity

* update copy in tooltip and group badge
2022-10-06 11:15:52 -07:00
Walter Rafelsberger
4753d7c170
[ML] Explain Log Rate Spikes: Fix error handling. (#142047)
- Fixes error handling that before was not providing enough information for debugging purposes and support. This will now output more fine grained error information to the Kibana server log. The analysis is now more resilient to errors for individual queries. For example, we don't stop the analysis anymore if individual queries for p-values or histograms fail.
- Moves the error callout above all other possible elements like empty prompts when the analysis doesn't return results.
2022-10-04 13:50:55 +02:00
Walter Rafelsberger
5203f1bcc8
[ML] Explain Log Rate Spikes: Fix loading state for grouping. (#141770)
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.
2022-10-03 10:25:39 +02:00
Quynh Nguyen (Quinn)
e7c2983173
[ML] Fix date picker not allowing unpause when refresh interval is 0 (#142005)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-30 09:33:56 -07:00
James Gowdy
2b09477759
[ML] Improving log pattern analysis messaging (#141130)
* [ML] Improving log pattern analysis messaging

* moving to separate component

* translations

* fixing unselection when time range changes

* changes based on review
2022-09-28 10:06:15 +02:00
Melissa Alvarez
24b7d34c55
[ML] Explain Log Rate Spikes: Add tooltip for group columns and adjust copy to reflect groups in ot… (#141687)
Updates the groups table column tooltips to reflect group language and adds a tooltip to the Group column for clarification of column values.
2022-09-26 14:16:29 +02:00
Walter Rafelsberger
8937be2db4
[ML] Explain Log Rate Spikes: Fix analysis table row pinning. (#141455)
- Fixes styling of hovered and pinned rows to use EUI provided variables.
- The above was also done for the Log Pattern Analysis page to fix an issue with dark theme.
- Fixes unpinning a row for field/value pairs.
- Fixes pinning/unpinning for groups.
2022-09-26 01:30:03 -07:00
Walter Rafelsberger
dd2cfb7ac2
[ML] Explain Log Rate Spikes: Adds jest tests for query_utils/buildBaseFilterCriteria. (#141213)
Adds jest tests for query_utils/buildBaseFilterCriteria.
2022-09-22 15:55:46 +02:00
Melissa Alvarez
4acc6e5d6a
[ML] Explain Log Rate Spikes: add main chart sync on row hover at group level (#141138)
* add hover main chart sync at group level

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

* fix overall request with groups

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

* ensure all pairs in group are considered in query

* add alignment to log rate column

* fix types

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-20 17:56:12 -06:00
Walter Rafelsberger
841b9300a7
[ML] Explain Log Rate Spikes: Add link to Discover to grouped results table. (#141071)
Adds link to Discover to grouped results table.
2022-09-20 22:46:38 +02: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
Melissa Alvarez
130a8cde54
[ML] Explain Log Rate Spikes: merge duplicate spikeAnalysisTable components (#141116)
* merge duplicate spikeAnalysisTable components

* [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-09-20 11:37:31 -06: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
6b0b3583cf
[ML] Update d3 related packages. (#140913)
This fixes some inconsistencies in versions used for `d3-*` and `@types/d3-*`. As part of this, related packages have been updated to the latest non-ESM-based versions. (The very latest d3 package versions were updated to be ESM only which we cannot use yet in the current Kibana server side setup).

Note that while this includes major version bumps, the d3 packages were bumped because of changes in JS language support and because they dropped IE support, not because of breaking API changes in the modules themselves.

- Updates `d3-array` from `1.2.4` to `2.12.1`. Removed usage of the package's `min/max` function to use native `Math.min/Math.max` instead.
- Fix `@types/d3-interpolate` to match version `3.0.1`.
- Updates `d3-scale` from `2.2.2` to `3.3.0`. Fixes version mismatch with `@types/d3-scale`.
- Updates `d3-shape` from `1.1.0` to `2.1.0`. Fixes version mismatch with `@types/d3-shape`.
- Updates `d3-time` from `1.1.0` to `2.1.1`. Fixes version mismatch with `@types/d3-time`.
- Removes `@types/d3-time-format` because the package `d3-time-format` is no longer used.
2022-09-20 02:54:55 -07:00
Pierre Gayvallet
9579ea7235
Move src/core/types/elasticsearch to @kbn/es-types (#140522)
* create empty package

* move types to packages

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

* start fixing imports

* fix more imports

* fix inline import

* add apm-ui as owners

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

* fix new usages

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-20 10:32:13 +02:00
James Gowdy
0bfc3fd41a
[ML] Log pattern analysis UI (#139005)
* [ML] Log caegorization UI POC

* improvements

* code structure changes

* further refactoring

* fixes after merge with main

* fixes after merging with main

* adding table pagination

* catching category request errors

* small refactor

* fixes after merge with main

* further fixes are merge with main

* showing errors in toast

* updating breadcrumbs

* translations and removing unused files

* changing case of side nav items

* translations

* updating actions

* fixing unused variable

* translations

* adding comment

* small changes based on review

* improving search request type

* capitalizing discover

* changes based on review

* fixing chart tooltip

* fixing examples from fields containing dots

* fixing breadcrumbs

* [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-09-16 10:31:41 +01:00
Walter Rafelsberger
2c2c0c0d61
[ML] Explain Log Rate Spikes: Fix frequent_items agg config. (#140814)
- Tweaks the `frequent_items` agg config. `should_minimum_match:2` for the terms should clause improves getting back groups of results. `minimum_set_size:2` will avoid single item frequent sets.
- Passes on a possible filter bar query to the `frequent_items` agg.
2022-09-15 18:43:28 +02:00
Melissa Alvarez
af7337597c
[ML] Explain Log Rate Spikes: sample groups table view (#140464)
* wip: create groups table

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

* show significant terms data in groups expanded row

* update mock data to reflect new data format

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

* sort group fields alphabetically

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

* replace mock data with api data

* fix functional test and remove commented code

* update types

* update functional tests

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-15 07:52:26 -06: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
52febd8807
[ML] Explain Log Rate Spikes: Improve app dependency handling. (#140005)
Improves dependency handling. Previously we had a mix of plugin dependencies and kibana context values passed on from the ML plugin. Now we have a single context that gets dependencies passed on from the parent container in the ML plugin.
2022-09-08 09:58:33 -07:00
Walter Rafelsberger
1ff209a603
[ML] Explain Log Rate Spikes: Histogram fixes. (#139933)
Fixes histogram styling, some alignments with discover chart.

- Switch BarSeries to HistogramBarSeries.
- Fix too generic IDs.
- Align y axis ticks settings with Discover chart.
- Fixes horizontal margins.
- Fixes x domain to avoid empty buckets at start and end of histogram.
2022-09-08 03:24:35 -07:00
Constance
98f73d674a
Upgrade EUI to v63.0.6 - updates to new EuiPageTemplate and deprecates old page components (#139524)
* Update all usages of EuiPageTemplate to EuiPageTemplate_Deprecated

* EuiPageContent_Deprecated as EuiPageContent

* EuiPageContentBody_Deprecated as EuiPageContentBody

* EuiPageContentHeader_Deprecated as EuiPageContentHeader

* EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection

* EuiPageSideBar_Deprecated as EuiPageSideBar

* EuiPageContent__Deprecated to EuiPageContent_Deprecated

* Fix rogue semi-colons

* WIP: NoDataConfigPage & NoDataPage converted to new template

- `withSolutionNav` not yet handled

* WIP: KibanaPageTemplateInner converted to use new template

- Pushes existing `pageHeader` prompts onto created EuiPageTemplate.PageHeader
- Uses `isEmptyState` to push `pageHeader` props to EuiPageTemplate.EmptyPrompt instead (if `children` are not supplied)

* WIP: `withSolutionNav` now renders the sidebar content properly

- Collapsing isn’t working (minWidth isn’t updating)

* Fixing stickiness of sidebar

* [Security] Fixed SecuritySolutionTemplateWrapper’s usage

- Moved `bottomBar` to EuiPageTemplate.BottomBar (now contained in just the page contents)
- Change EuiPanel children wrapper with EuiPageTemplate.Section

* [O11y] Wrap `children` with EuiPageTemplate.Section

* Fix getting_started usage

* WIP: Fixing types

* Removing `template` pass through

* Set EUI to 63.0.0

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

* More import fixes

* Sidebar component update

* Expand `KibanaPageTemplate` to all namespaced EUI counterparts

- Updated `docs/tutorials` mdx page
- Fixed SolutionNav prop types

* Updated the tutorial mdx page

* [Stack Management] Updated app layout to new template

- Some temporary props applied for BWC until all other pages can be converted
- Converted `API Keys` page’s layout (and especially prompt usags) to new paradigm

* Fix circular dep

* Fix new circular dependency

- copying and pasting types from KibanaPageTemplateProps, but ah well

* [Security Solution] Remove `template` prop - no longer a prop on Kibana/EuiPageTemplate

* [O11y] Allow customizing EuiPageTemplate.Section wrapper

- converts pageBodyProps
- fixes non-centered loading template

* [Enterprise Search] Update page templates

- fix layouts by auto-wrapping an EuiPageSection for padding, while adding a `customPageSections` prop for more custom sections/layouts

- re-center 404 errors

- update tests

* Update KibanaPageTemplate tests

* Update snapshots

* Fix FTR test with removed EUI classNames

* Fix FTR tests with changed kbn classNames

* Update failing dashboard snapshots

- drop shadow changed slightly in EUI

* Fix failing Security Cypress test

* [O11y] Fix Inventory page using deprecated CSS hooks

* [O11y][Uptime] Fix missing bottom bars

- Modifies ObservabilityPageTemplate to accept a `bottomBar` prop (a la the old EuiPageTemplate behavior)

NOTE: This opinionated page layout structure is starting to feel like it could be potentially limiting / have all the same pitfalls the previous EuiPageTemplate did. If so, consider something closer to the Enterprise Search page template conversion (`customPageSections`).

- Misc cleanup: Use `KibanaPageTemplate` over `EuiPageTemplate`

* [O11y] Fix route template typing

- Since theObservabilityPageTemplate is using the new Eui/KibanaPageTemplate, its child templates and types need to be updated accordingly

* Fix broken minWidth behavior

- was an EUI issue that required a patch release
+ update snapshots

* [Security Solution] Type fixes, restore empty state

- Fix empty state logic removed in a previous commit
- bogarts KibanaPageTemplate's `isEmptyState` prop instead of using `template="noData"`

- extend template wrappers to past ...rest to underlying Kibana/EuiPageTemplate

+ replace EuiPageTemplate with KibanaPageTemplate for consistency

* Fix failing synthetics selector

* Grab EUI v63.0.6

- for deprecation tags and section tag support

* Fix Kibana Overview plugin layout

- needs to use KibanaPageTemplate.Section to get padding back

- use `bottomBorder` prop over horizontal rules

- restore previous page color via panelled=false

* Convert Home plugin to new KibanaPageTemplate

- use KibanaPageTemplate.Section instead to preserve page width/paddings

- use `bottomBorder` instead of `EuiHorizontalRule`

- NOTE: This causes margins to decrease slightly from xxl to xl (largest padding available for EuiPageSection) - this can be restored by CSS overrides if desired

- update CSS to preserve previous looks, + convert to logical properties

* [O11y] Fix non-centered empty/loading states

* [O11y] Restore subdued background on various empty state prompts

* [O11y] Fix all instances of views that require a scrollable full-height child

+ restore comment for inventory view

* [O11y][ux] Fix broken sidebar

- The entire app was missing a wrapping EuiProvider, and as such breakpoint utils were not working, and the sidebar was missing

+ misc cleanup
  - remove unnecessary fragment
  - remove role="main" attr - now that EuiPageTemplate sets a `main` tag, they'll conflict
  - add isEmptyState to center loading component

* [APM Cypress tests] harden flaky test

* [APM Cypress tests] Fix failing Cypress test, again

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-07 15:35:23 -05:00
Melissa Alvarez
7a83e87560
[ML] AI Ops: Adds discover link to analysis table (#139877)
* wip: create linksMenu component for discover url

* adds actions column to spikeanalysis table with link to discover

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

* use EuiTable built in Actions column type for Discover link

* remove linkMenu

* fix localization messages

* set fixed width for actions column

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

* update link icon and simplify discoverUrlError setting

* Update x-pack/plugins/aiops/public/components/spike_analysis_table/spike_analysis_table.tsx

Co-authored-by: Dima Arnautov <arnautov.dima@gmail.com>

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dima Arnautov <arnautov.dima@gmail.com>
2022-09-07 09:58:14 -06: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
9a1a963ae3
[ML] Explain Log Rate Spikes: Basic functional tests. (#138387)
Adds first functional tests for Explain Log Rate Spikes. The test clicks the menu item, selects an index, clicks the "Use full data" button and asserts the page's elements.
2022-08-11 10:51:51 +02: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