Commit graph

278 commits

Author SHA1 Message Date
Dima Arnautov
8e59304a06
[ML] AIOps: Fix relative time bounds for the change point embeddable (#169794)
## Summary

Fixes https://github.com/elastic/kibana/issues/169736

<img width="1240" alt="image"
src="db86b0b9-ad29-450c-a973-a6c68b9725e7">


Fixes relative time bounds for the change point embeddable.
2023-10-26 11:12:34 +02:00
Walter Rafelsberger
5c578a06b3
[ML] AIOps: Improve flushFix for Log Rate Analysis (#165069)
Improves the `flushFix` behaviour for Log Rate Analysis. Previously the
setting would add a 4KB size additional dummy payload to each object
returned as ndjson. For the dataset used for testing this, this would
result in an overall response payload of ˜900Kbytes. For comparison,
without `flushFix` the response size would be ˜40Kbytes in this case.
This PR changes the behaviour to only send a dummy payload every 500ms
if the real data sent in the last 500ms wasn't bigger than 4Kbytes.
Depending on the speed of the response, this can bring down the overall
response payload to ˜300Kbytes (Cloud uncached), ˜150Kbytes (Cloud
cached) or even ˜70Kbytes (local cluster) for the same dataset.
2023-10-25 18:09:08 +02:00
Melissa Alvarez
7e97dd90e7
[ML][AIOps] Telemetry: Track change point detection runs (#169158)
## Summary

This PR adds UI tracking for Change Point Detection for AIOps.

- tracks type of analysis and source (where the analysis is being run
from)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
2023-10-25 08:34:06 -06:00
Marta Bondyra
9e951f59ac
[Lens] passing locale to charts (#168571)
## Summary

<img width="973" alt="Screenshot 2023-10-17 at 11 13 20"
src="ff08efbe-dec7-4a45-ad25-17debb679864">

Passes `locale={i18n.getLocale()}` to <Settings/> Component for elastic
charts. For now it only matters for translating months, days etc in time
histogram chart, but I'd rather pass it everywhere in case if we
introduce some copy in the future.

Fixes https://github.com/elastic/kibana/issues/166240
2023-10-17 03:12:38 -07:00
Devon Thomson
7cb153d4d7
Fix ML swimlane embeddable titles (#168647)
Stops the ML Embeddables from setting the default title and default description on their outputs during initialization.
2023-10-13 09:28:57 -04:00
Walter Rafelsberger
9259f4836e
[ML] AIOps: Functional/API integration tests for text field support for log rate analysis (#168177)
This updates the artificial dataset generator for log rate analysis to
allow to create variants including text fields.
The artificial dataset is now used for 4 variants of functional and API
integration tests: Testing spike and dip with both with and without a
text field.

The new tests surfaced some issues that were fixed as part of this PR:

- Getting the counts of log patterns in combination with individual
significant terms ended up with to granular groups. This PR adds
additional queries to get counts for log patterns in combination with
item sets already derived from significant terms.
- The `support` value is returned by the frequent item sets agg and is
used as a threshold whether to include an item set for grouping. This
was missing from significant log patterns and is fixed by this PR.
- Adds a check to not get frequent item sets for log patterns if there
are no significant terms.
- The way we fetched log patterns using a time filter that spans the
whole of the baseline start to the deviation end caused problems with
analysing dips. This PR updates those queries to only fetch the actual
baseline and deviation time range.
- The integration tests caught an issue where we'd still fetch the
histogram for log patterns even if we'd request grouping information
only.
2023-10-10 19:24:08 +02:00
Dima Arnautov
9f06e30a4e
[ML] AIOps: Fix Data View runtime fields support in Change point detection UI (#168249)
## Summary

Fixes [#162212](https://github.com/elastic/kibana/issues/168212)

If a Data View runtime field is used as a metric or split field, appends
a `runtime_mappings` to the search request.

### Checklist

- [ ] [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
2023-10-10 16:55:03 +02:00
James Gowdy
b5bf4a186c
[ML] AIOPs: Fixing log pattern analysis sparklines and chart (#168337)
Fixing two issues with the log pattern analysis charts:

Occasionally the count of docs in a category can be slightly greater
than the doc count which causes the chart to render negative values when
hovering over a category in the table.

Broken:

![image](0559c060-4bf3-406a-a9be-88eef8942585)

Fixed:

![image](52b3a0ed-66a6-45f9-ae79-e75afa2728c1)


---

The sparkles were incorrectly not subtracting the difference from the
doc count. So they always rendered the pattern count on top of the doc
count.

Broken:

![image](81dc7d83-5cbe-4576-b087-7fff078dfee7)

Fixed:

![image](0f00609f-932c-4fab-b946-58aa5ea34bd8)
2023-10-09 15:28:28 +01:00
Alejandro Fernández Haro
baff0eb32c
Fix some unhandledRejections (#168009) 2023-10-06 13:44:52 +02:00
Walter Rafelsberger
d8886d83c4
[ML] AIOps: Support text fields in log rate analysis (#165124)
Part of #167467.

Adds support for text fields in log pattern analysis. Text fields will
be analysed using log categorization, similar to log pattern analysis.
Significant log patterns will be identified using the `chi2test`
package, similar to how we detect data drifts.
2023-10-04 11:23:26 +02:00
James Gowdy
eddcdbea24
[ML] Catching registration errors after license change (#167622)
We register our cases integration after checking that the license level
is platinum or trial, however if the license changes from platinum ->
basic and then back again, we attempt to register them again. This
throws an error during kibana start up.

To test, change the license level platinum/trial -> basic and then basic
-> platinum.
There will now be a warning the log `ML failed to register cases
persistable state for ml_anomaly_swimlane`

Also updates the AIOPs change point cases registration which also should
only be registered when running with a platinum or trial license.
2023-10-03 01:11:59 -07:00
Nathan Reese
b5bcf69022
[search source] remove is_partial check (#164506)
Closes https://github.com/elastic/kibana/issues/164893

### Background

"is partial" has 2 meanings
1) Results are incomplete because search is still running
2) Search is finished. Results are incomplete because there are shard
failures (either in local or remote clusters)

[async
search](https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html)
defines 2 flags.
1) `is_running`: Whether the search is still being executed or it has
completed
2) `is_partial`: When the query is no longer running, indicates whether
the search failed or was successfully completed on all shards. While the
query is being executed, is_partial is always set to true
**note**: there is a bug in async search where requests to only local
clusters return `is_partial:false` when there are shard errors on the
local cluster. See
https://github.com/elastic/elasticsearch/issues/98725. This should be
resolved in 8.11

Kibana's existing search implementation does not align with
Elasticsearch's `is_running` and `is_partial` flags. Kibana defines "is
partial" as definition "1)". Elasticsearch async search defines "is
partial" as definition "2)".

This PR aligns Kibana's usage of "is partial" with Elasticsearch's
definition. This required the following changes
1) `isErrorResponse` renamed to `isAbortedResponse`. Method no longer
returns true when `!response.isRunning && !!response.isPartial`. Kibana
handles results with incomplete data. **Note** removed export of
`isErrorResponse` from data plugin since its use outside of data plugin
does not make sense.
2) Replace `isPartialResponse` with `isRunningResponse`. This aligns
Kibana's definition with Elasticsearch async search flags.
3) Remove `isCompleteResponse`. The word "complete" is ambiguous. Does
it mean the search is finished (no longer running)? Or does it mean the
search has all results and there are no shard failures?

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2023-10-02 13:25:08 -06:00
Dima Arnautov
772739ab40
[ML] AIOps: Additional props for Change Point embeddable (#167606) 2023-09-29 18:24:10 +02:00
Melissa Alvarez
0bdbcc0ccc
[ML][AIOps] Telemetry: track analysis endpoint usage (#166988)
## Summary

This PR adds tracking for Log Rate Analysis and Log Pattern Analysis
endpoints for AIOps.
- tracks type of analysis and source (where the analysis is being run
from)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-29 09:12:09 -07:00
Walter Rafelsberger
adc9ab9c52
[ML] AIOps: Enable event_generating_elements_should_be_instrumented eslint rule. (#167317)
Implements #153108.

This enables the
`@kbn/telemetry/event_generating_elements_should_be_instrumented` eslint
rule for the `aiops` plugin to enforce `data-test-subj` attributes on
actionable EUI components so they are auto-instrumented by telemetry.

The ids were first auto-created using `node scripts/eslint --fix
x-pack/plugins/aiops` and then adapted.
2023-09-28 11:49:13 +02:00
Walter Rafelsberger
0d97cc71fc
[ML] AIOps: Move log pattern analysis fetch code to common to be available via server (#167465)
Follow up to #167237.
Part of #167467.

We plan to reuse some of the queries log pattern analysis does to use
via log rate analysis too. Log pattern analysis mostly does queries from
the client side, late rate analysis has its own API endpoint and does ES
queries via Kibana server. In preparation for the use via log rate
analysis, this moves the code we need to have available server side for
log rate analysis to the `common` area of the plugin so it can be used
both on server/client.
2023-09-28 11:00:05 +02:00
James Gowdy
c18513e23d
[ML] Removing global isServerless flag (#166651)
Removed `isServerless` flag which lived in our global context and had to
be passed about to the various components which create their own version
of the context using `getMlGlobalServices`
This PR adds a new context which contains flags for all of the features
which can be toggled when in serverless mode.
Flags added:
```
 showNodeInfo
 showMLNavMenu
 showLicenseInfo
 isADEnabled
 isDFAEnabled
 isNLPEnabled
```
The enabled features flags are now read from the config file client
side, rather than using capabilities.

Additional changes:
- Changes the wording of the awaiting ML node callout in serverless.
- In the search project, the default ML page is the trained models list
and not Overview
- Reenables the Memory Usage page for all projects

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-27 09:32:17 +01:00
Walter Rafelsberger
fabaa2f89e
[ML] AIOps: Fix render loop when using saved search. (#166934)
## Summary

Fixes #166079.

If a user picked a saved search to investigate, the log pattern analysis
page would freeze with an infinite render loop; the log rate analysis
pate wouldn't freeze but repeatedly query for new data.

This PR fixes the issue by memoizing the queries derived from the saved
search information to avoid it being a new instance every time.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-09-21 17:28:38 +02:00
James Gowdy
09faf897c9
[ML] Serverless compatibility fixes (#163724)
**ML Management page**
- Fixes general page loading issues.
- Ensures only enabled features are shown as tabs
- Ensures only jobs for enabled features can be exported and imported.
- Ensures only enabled features are listed in the saved object sync
output.
- On trained models tab:
  - Only lists DFA models if NLP is disabled.
  - Only lists non-DFA models if DFA is disabled.

**Anomaly Detection**
- Hides node information in anomaly detection jobs list.
- Hides the Exclude frozen data option in the Use full time range
selector in job wizards.

**Data frame analytics**
 - Hides all node and license level information.

**Trained models**
 - Only lists DFA models if NLP is disabled.
 - Only lists non-DFA models if DFA is disabled.
 - Hides all node and license level information.
 - Hides DFA nodes 

**Notifications and memory usage**
- Ensures only enabled features are mentioned. Including selectable
types in the search bar filters.

**Integrations with other plugins**
- Changes registration for integrations into other plugins so they only
happen if the relevant feature is enabled.
   - Client side: UI actions, cases, embeddables, alerts, maps.
   - Server side: Sample data sets, cases

**AIOPS**
- Hides the Exclude frozen data option in the Use full time range
selector on all pages

**Notes for non ML team reviewers**

**response-ops**
I've divided the
[persistable_state.ts](https://github.com/elastic/kibana/pull/163724#diff-e02dc0b6cb5b63965372b1f4a84d2287cba31a15ab525ab7983f02d09f23879f)
test into basic and trial version.
The ML cases attachments should only be registered if anomaly detection
is available in a trial or platinum license. This was a bug which I
noticed when making serverless changes.

 **Observability**
I've made a few minor changes to the nav menu, fixing names of ML
features and adding the missing Change point detection AIOPs page.

**Security solution**
I've made a few minor changes to the nav menu, fixing names of ML
features and adding some missing ML features.
I think the icons being used will need to be revisited before release as
we have [official ML
icons](https://elastic.github.io/eui/#/display/icons#apps) but not for
every page. So we should probably either have new icons created or all
agree on which standard non-ML icons should be used for the ones which
are missing.

**Search**
The NLP feature is currently disabled in main, I believe this was an
attempt to stop ML anomaly detection alert rules from being registered.
I've reenabled NLP and changed the way we're registering the alerts.
They will now only be registered if the anomaly detection feature is
enabled.


Fixes https://github.com/elastic/kibana/issues/163372
2023-09-13 12:07:55 -07:00
Nathan Reese
0113eb74c8
remove unneeded usages of isErrorResponse (#164609)
`data.search` uses
[poll_search](https://github.com/elastic/kibana/blob/main/src/plugins/data/common/search/poll_search.ts)
to fetch data. `poll_search` checks for `isErrorResponse` and throws
when`isErrorResponse` is true. **Note** `searchSource.search` uses
`data.search` to perform searches.

```javascript
   return from(search()).pipe(
      expand(() => {
        const elapsedTime = Date.now() - startTime;
        return timer(getPollInterval(elapsedTime)).pipe(switchMap(search));
      }),
      tap((response) => {
        if (isErrorResponse(response)) {
          throw response ? new Error('Received partial response') : new AbortError();
        }
      }),
      takeWhile<Response>(isPartialResponse, true),
      takeUntil<Response>(aborted$)
    );
```

Subscribers to `data.search` and `searchSource.search` do not need to
check for `isErrorResponse` in `next`. `poll_search` has already thrown
then the response is `isErrorResponse` so these checks are dead code
blocks that are never executed.

This PR removes these dead code blocks. Breaking this change out of
https://github.com/elastic/kibana/pull/164506 so that it can be reviewed
in isolated.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-28 11:40:26 -06:00
Dima Arnautov
5d5ac37e9e
[ML] Fix query bar autocompletion for ML and AIOps embeddables (#164485) 2023-08-24 00:08:23 +02:00
James Gowdy
af440aae4b
[ML] Fixes dark mode in flyouts and modals (#164399)
A recent EUI change has caused a problem with the theme when using the
deprecated `toMountPoint` inside `overlays.openFlyout` to create
flyouts.
This causes the contents of the rendered flyout to not know the current
theme, this is obvious when running in dark mode.

The fix is to switch to the non-deprecated version of `toMountPoint`.

Flyouts:
Create anomaly detection job from Lens flyout in Dashboard.
Anomaly swim lane and anomaly chart job embeddables job selection flyout
in Dashboard.
Log pattern analysis flyout in Discover.

Modals:
Trained models start deployment modal.
Trained models force stop deployment modal.
Trained models stop deployment modal when there are multiple
deployments.

Misc:
Page not found banner.
Jobs list header, which contains the settings button.
DFA clone job warning toast when the original data view no longer
exists.
Components in ml's date picker package

Fixes https://github.com/elastic/kibana/issues/164379

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dima Arnautov <arnautov.dima@gmail.com>
2023-08-23 11:47:18 +01:00
Dima Arnautov
fb6ac2e445
[ML] AIOps: Add/edit change point charts embeddable from the Dashboard app (#163694) 2023-08-15 19:10:07 +02:00
Walter Rafelsberger
da0fb1d987
[ML] AIOps: Auto-detect if spike or dip selected in log rate analysis. (#163100)
This updates log rate analysis to be able to auto-detect whether the
selected deviation is a spike or dip compared to the baseline time
range. To achieve this, we compare the median bucket size of the two
selections. If a dip gets detected, the analysis will then switch the
window parameters sent to the API endpoint to run the analysis.

An info callout points out the auto-selected analysis type and explains
to which time range the analysis results refer to. We need to do this to
make it clear that for dip analysis the significant terms and their doc
counts refer to the baseline time range and vice versa for spike
analysis.
2023-08-09 08:05:07 +02:00
Dima Arnautov
b62747e085
[ML] AIOps: Adds change point detection charts embeddable (#162796)
## Summary

Part of #161248 

- Adds Change point charts as an embeddable component 
- Allows attachment of selected partitions to a new / existing dashboard
![Aug-01-2023
14-46-49](cba12d6e-7e2b-481e-a788-18435a0a9840)
- Allows attachment of top N change points (with an ascending sorting by
`p_value`)
![Aug-01-2023
14-55-10](d99e119d-c428-49d0-bc76-7a33a3ce4ffd)
- Allows applying a persistent time range 
- Attachment to a case of a single change point / selected partitions
and applied time range
![Aug-01-2023
15-07-33](1c4cc131-0897-4fc4-8f45-e8118ab1f941)
- Exposes `EmbeddableChangePointChart` embeddable component as part of
the plugin start contract


### Checklist

Delete any items that are not applicable to this PR.

- [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)
- [ ]
[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))
- [ ] 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))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2023-08-08 17:33:51 +03:00
Walter Rafelsberger
b8bb4ee34b
[ML] AIOps: Improve table hovering for log rate analysis. (#162941)
Improves the table hovering behavior for log rate analysis:
- When no row is hovered, it falls back to set the first row of the
current page to a hovered state. The result is that users will always
see a comparison view in the main document count chart.
- When a row gets pinned, the hovering of the other rows will be
disabled, so the comparison view in the main document count chart gets
locked on the pinned row.
2023-08-08 10:31:32 +02:00
Walter Rafelsberger
581768116a
[ML] AIOps: Fix missing comments/exports/anys. (#162966)
## Summary

Fixes comments/exports/anys in the `aiops` plugin. Commands to check
are:

```bash
node scripts/build_api_docs --plugin aiops --stats comments
node scripts/build_api_docs --plugin aiops --stats exports
node scripts/build_api_docs --plugin aiops --stats any
```

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-08-03 14:35:37 +02:00
Walter Rafelsberger
0dabaca508
[ML] AIOps: Adds dip support for log rate analysis in observability alert details page. (#162476)
Adds support for analysing dips for log rate analysis on Observability's
alert details page.

- This removes the filter against
`Comparator.GT/Comparator.GT_OR_EQ` which hides log rate analysis for
log threshold alerts. Instead an `analysisType` is passed on to log rate
analysis: When analysing dips the baseline and deviation ranges will be
switched for both the analysis and the brush labels on the document
count chart.
- Updates all references to "spikes" only in UI text, e.g. the AI
Assistant prompt.
2023-08-01 18:37:13 +02:00
Quynh Nguyen (Quinn)
0728003865
[ML] Add new Data comparison view (#161365)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-31 08:24:01 -07:00
James Gowdy
716ecb8a04
[ML] Log pattern analysis field validation (#162319)
Uses the recently created [category validation
package](https://github.com/elastic/kibana/pull/161261) to perform
validation on the field selected for pattern analysis.

If the field is considered unsuitable for categorization, a warning
callout is displayed which lists the reasons it is unsuitable.
If the field is suitable, no callout is displayed.

Other changes:
- Adds the selected field to the URL state, so it is remembered on page
refresh.
- If no field is in the URL, it will look for a field called `message`
in the data view and auto select it.
- renames the ML route `/jobs/categorization_field_examples` to
`/jobs/categorization_field_validation` as it is a more accurate name
and it's consistent with the newly added route in AIOPs.

**Log Pattern Analysis page in ML**


![image](c0dfda8b-bc34-48b7-9e71-8bae9e65bdf3)


**Log Pattern Analysis flyout in Discover**


![image](b4d251f3-bae6-424f-9891-bda57ba1673d)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-28 16:44:23 +01:00
Walter Rafelsberger
0ab24e566c
[ML] AIOps: Use Kibana's http service instead of fetch, fix throttling. (#162335)
- Originally Kibana's `http` service did not support receiving streams,
that's why we used plain `fetch` for this. This has been fixed in
#158678, so this PR updates the streaming helpers to use Kibana's `http`
service from now on.
- The PR also breaks out the response stream code into its own package
and restructures it to separate client and server side code. This brings
down the `aiops` bundle size by `~300KB`! 🥳
- The approach to client side throttling/buffering was also revamped:
There was an issue doing the throttling inside the generator function,
it always waited for the timeout. The buffering is now removed from
`fetchStream`, instead `useThrottle` from `react-use` is used on the
reduced `data` in `useFetchStream`. Loading log rate analysis results
got a lot snappier with this update!
2023-07-27 08:57:10 +02:00
Walter Rafelsberger
11cc1e1be6
[ML] AIOps: Rename Explain Log Rate Spikes to Log Rate Analysis. (#161764)
## Summary

Part of #161832.

This PR renames the Explain Log Rate Spikes feature to **Log Rate
Analysis**.

- [x] Renamed references in `docs/developer/*`
- [x] Updated docs screenshots
- [x] Redirect in docs
- [x] Redirect urls from `explain_log_rate_spikes` to `log_rate_analysis`
- [x] API versioning
- [x] Renamed navigation links
- [x] Renamed variable names
- [x] Renamed file names
- [x] Renamed i18n ids
- [x] Renamed breadcrumbs 
- [x] Removed hard coded `AIOPS_ENABLED` feature flag
2023-07-19 16:46:31 +02:00
Cee Chen
b9eae62b5d
Order Emotion styles before Sass styles (#161592)
## Summary

fixes https://github.com/elastic/kibana/issues/161441
fixes https://github.com/elastic/kibana/issues/161464

The recent `EuiButtonEmpty`/`EuiButtonIcon` Emotion conversions have
highlighted a CSS order/specificity flaw in Kibana compared to EUI - EUI
orders its Sass _after_ its Emotion styles (see
https://elastic.github.io/eui/#/), and Kibana orders Sass _before_
Emotion styles.

I'm not totally sure why Greg set up Kibana's style order the way he did
in https://github.com/elastic/kibana/pull/134919, but at this point, EUI
has enough of its baseline atom components converted to Emotion that
remaining components in Sass are all generally molecules or higher level
components that need to come after Emotion.

### QA

- [x] Test as many pages in Kibana as possible to ensure no visual
regressions 🤞

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-07-13 07:41:17 -07:00
James Gowdy
3dfbe8ab98
[ML] Log pattern analysis functional tests (#160171)
Adds functional tests for the Log Pattern Analysis AIOPs page and
Discover integration.

ML app:
Selects a message field, checks category counts are correct, selects
bother "filter in" and "filter out" buttons which redirect to Discover
and apply a filter. Checks the total doc counts in discover match the
selected category.

In Discover:
Selects a message field which opens the flyout, checks category counts
are correct, selects bother "filter in" and "filter out" buttons which
close the flyout and apply a filter. Checks the total doc counts in
discover match the selected category.
2023-06-30 09:49:14 +01:00
renovate[bot]
b2c6c71a8d
Update dependency @elastic/charts to v58 (main) (#159082)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@elastic/charts](https://togithub.com/elastic/elastic-charts) |
[`57.0.1` ->
`58.2.0`](https://renovatebot.com/diffs/npm/@elastic%2fcharts/57.0.1/58.2.0)
|
[![age](https://badges.renovateapi.com/packages/npm/@elastic%2fcharts/58.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@elastic%2fcharts/58.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@elastic%2fcharts/58.2.0/compatibility-slim/57.0.1)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@elastic%2fcharts/58.2.0/confidence-slim/57.0.1)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>elastic/elastic-charts</summary>

#
[58.2.0](https://github.com/elastic/elastic-charts/compare/v58.1.0...v58.2.0)
(2023-06-23)


### Bug Fixes

* `Chart` component `children` type
([#2071](https://github.com/elastic/elastic-charts/issues/2071))
([525c782](525c782829))
* **deps:** update dependency @elastic/eui to v82
([#2074](https://github.com/elastic/elastic-charts/issues/2074))
([69a655f](69a655f0da))


### Features

* **flame:** expose search field text and search text change listener
([#2068](https://github.com/elastic/elastic-charts/issues/2068))
([c339947](c339947c39))
* support native chart title and description
([#2002](https://github.com/elastic/elastic-charts/issues/2002))
([341a990](341a990c5d))

#
[58.1.0](https://github.com/elastic/elastic-charts/compare/v58.0.0...v58.1.0)
(2023-06-08)


### Features

* **flame:** expose search control
([#2064](https://github.com/elastic/elastic-charts/issues/2064))
([011b56b](011b56b3f5))

#
[58.0.0](https://github.com/elastic/elastic-charts/compare/v57.0.1...v58.0.0)
(2023-06-06)


### Bug Fixes

* **axis:** reduce number of y axis ticks on linear scale
([#2005](https://github.com/elastic/elastic-charts/issues/2005))
([0ef828b](0ef828b535))
* **deps:** update dependency @elastic/eui to v81
([#2052](https://github.com/elastic/elastic-charts/issues/2052))
([4c55e01](4c55e0119e))


### BREAKING CHANGES

* **axis:** the default number of desired ticks in the Y-Axis was
changed from `10` to `5`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/elastic/kibana).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: nickofthyme <nicholas.partridge@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
2023-06-26 11:41:49 -07:00
Julia Rechkunova
7f0d57d9fd
[UnifiedFieldList] Convert from a plugin into a package (#158718)
- Closes https://github.com/elastic/kibana/issues/149336

## Summary

This PR converts `unifiedFieldList` plugin into a new
`@kbn/unified-field-list` package.

Had to also move some deps:
- from `uiActions` plugin to the existing `@kbn/ui-actions-browser`
package
- from `data` plugin to a new `@kbn/data-service` package

Please test that Field Stats from the package are still working on your
pages.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-23 14:28:12 +02:00
Dima Arnautov
d7b2a52e42
[ML] AIOps: Fix relative time bound support in the chart preview (#160121)
## Summary

- Fixes relative time range support in the Change Point Detection UI. 
- Enables functional tests (resolves
https://github.com/elastic/kibana/issues/158851)


### Checklist

- [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
2023-06-22 11:51:20 +01:00
James Gowdy
851b641c2d
[ML] Log pattern analysis non time series check (#160021)
Adds the check for non-time series data views to the Log Pattern
Analysis.
As all three AIOPs features now have the same check, I moved it to a
common component.

Part of https://github.com/elastic/kibana/issues/159355
2023-06-20 18:07:32 +01:00
Melissa Alvarez
5751f29f58
[ML] Explain Log Rate Spikes: allow sticky histogram (#159412)
## Summary

Related issue: https://github.com/elastic/kibana/issues/156605

This PR adds some ELRS style updates:

- adds options prop to allow 'stickyHistogram' - defaults to false for
now - until page restructure work is done to allow for smooth
interaction
- Moves the 'Clear' functionality to 'Reset' button in line with the
progress controls

<img width="1273" alt="image"
src="50bd3512-cad6-498e-b7a2-740a01151004">


### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] 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)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-15 07:26:33 -06:00
Walter Rafelsberger
632424e969
[ML] Explain Log Rate Spikes: Adds secondary sort by doc_count only if sorted by p-value (#159568)
Adds a secondary sort by `doc_count` only if the results table is sorted
by `p-value`. This is useful in cases when there are lots of items with
the same `p-value`. The combination of high significance (low `p-value`)
and sorted by `doc_count` ascending will surface the most unique
field/value combinations.
2023-06-15 12:49:52 +02:00
Walter Rafelsberger
b1128ea67b
[ML] Explain Log Rate Spikes: Optional overrides for chart colors. (#159193)
Adds an optional `barColorOverride` and `barHighlightColorOverride` to
able to set custom colors for the charts in Explain Log Rate Spikes.
2023-06-13 19:07:09 +02:00
Walter Rafelsberger
dd8ffe2225
[ML] Explain Log Rate Spikes: Expose analysis results via optional callback. (#159550)
## Summary

Related to https://github.com/elastic/kibana/pull/158960.

Adds an optional `onAnalysisCompleted` callback to able to act on the
final analysis results.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-06-13 17:30:51 +02:00
Walter Rafelsberger
6b99a51824
[ML] Explain Log Rate Spikes: Support WindowParameters for autoAnalysisStart. (#159111)
To allow for more fine grained control of the baseline and deviation
time ranges for `autoAnalysisStart` this PR allows to pass in a
`WindowParameters` object as an alternative to the plain timestamp. When
more useful metadata is available this might lead to better selections
then the default one provided by `getWindowParameters`.
2023-06-07 10:37:16 +02:00
Matthew Kime
22ccf83d66
[saved search] Content management integration (#158006)
## Summary

- Saved searches use content management api
- Saved search plugin provides proper plugin api instead of static
exports
- Discover no longer re-exports static content from saved search plugin
- ML no longer works directly with the saved search saved object
- saved object conflicts are thrown via the api, rather than the api
consumer
- Content management api logs failed requests a bit better, helpful for
tests failing in CI

Closes https://github.com/elastic/kibana/issues/157078

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-02 18:55:52 -07:00
Walter Rafelsberger
423cb35fd7
[ML] Versioning AIOps APIs (#158806)
Adds versioning to the AIOps API.
Versions are added to the server side routes and to the client side
functions which call the routes.
Updates API tests to add the API version to the request headers.

The single API endpoint is already internal and now has been given the
version '1'.

**Internal APIs**

`/internal/aiops/explain_log_rate_spikes`
2023-06-01 16:36:59 +02:00
Melissa Alvarez
03d4fe7515
[AIOps] Explain Log Rate Spikes: create shareable component containing only analysis (#158629)
## Summary

This PR exposes the `ExplainLogRateSpikesContent` shared component so
that it can be used independently of the search bar/datepicker
- The component accepts various external settings including a timerange
and query to run the analysis against.
- The `ExplainLogRateSpikesPage` component now uses the
`ExplainLogRateSpikesContent` component
- The `useData` hook has been simplified - the set up for the search
query has been extracted into a separate hook

<img width="1245" alt="image"
src="30dec4b2-3162-4a39-b598-0dec70993fa7">

This is the first step for the Observability Alert Details Page
Integration.

Style edits:

The component now uses EUI's ResizeableContainer to allow the main
histogram to be sticky.
Also adds some style updates from
https://github.com/elastic/kibana/issues/156605


### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] 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)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2023-05-30 13:44:59 -06:00
Yan Savitski
815fddb9f0
[Search Application] Use ES JS client instead of Transport (#158446)
- ✔️ Update es client version
- ✔️ Replace transport api to es client
- ✔️ Update tests
- ✔️ Fix TS issues
2023-05-30 05:16:40 -07:00
Dima Arnautov
c5eee26671
[ML] Apply theme based on the User Profile settings (#158258)
## Summary

With the release of Per User Dark Mode, code should no longer rely on
calling `uiSettings` to determine which theme Kibana is displayed with.

With theme settings now configurable from User Profiles and Adv.
Settings, the code that was calling uiSettings to determine the Kibana
theme will not take into account which theme is currently being
displayed.


Applies an appropriate EUI theme based on the profile settings. In
particular for the following components:
- Anomaly swim lane (Fixes #158155 )
- Job tree map view (Fixes
https://github.com/elastic/kibana/issues/158304)
- Charts-related theme settings, e.g. the Single Metric Viewer
2023-05-25 11:57:48 +02:00
Dima Arnautov
3db3709eb4
[ML] Add functional tests for Change Point Detection UI (#158164)
## Summary

Part of https://github.com/elastic/kibana/issues/157980

Adds functional tests for the Change Point Detection UI.

### Checklist

- [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
2023-05-23 13:26:09 +02:00
Cee Chen
b9ea4ce4f5
Upgrade EUI to v79.0.1 (#156925)
## Summary

`eui@77.2.2`  `eui@79.0.1`

🦴 The primary changes in this upgrade are around the deprecated
`EuiLoadingContent` being removed in favor of `EuiSkeletonText`.
- Most instances have been a [direct swap of
usage](327626a7be),
but [some replacements were a bit more
opinionated](e6ceb36a75)
as I saw them as potential to take advantage of `EuiSkeletonText`'s
syntactical sugar and screen reader announcements for when state
switches to loaded.

---

## [`79.0.1`](https://github.com/elastic/eui/tree/v79.0.1)

**Bug fixes**

- Fixed broken push `EuiFlyout` behavior
([#6764](https://github.com/elastic/eui/pull/6764))


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

- Updated all `EuiSkeleton` components with new props that allow for
more control over screen reader live announcements:
`announceLoadingStatus`, `announceLoadedStatus`, and `ariaLiveProps`
([#6752](https://github.com/elastic/eui/pull/6752))
- Improved keyboard accessibility in `EuiPageHeader` by ensuring the
right side menu items come into focus from left to right.
([#6753](https://github.com/elastic/eui/pull/6753))

**Breaking changes**

- Removed deprecated `EuiLoadingContent`. Use the `EuiSkeleton`
components instead. ([#6754](https://github.com/elastic/eui/pull/6754))


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

- Improved the contrast ratio of `EuiCheckbox`, `EuiRadio`, and
`EuiSwitch` in their unchecked states to meet WCAG AA guidelines.
([#6729](https://github.com/elastic/eui/pull/6729))
- Added React Testing Library `*ByTestSubject` custom commands to
`within()`. RTL utilities can be imported from
`@elastic/eui/lib/test/rtl`.
([#6737](https://github.com/elastic/eui/pull/6737))
- Updated `EuiAvatar` to support a new letter `casing` prop that allow
customizing text capitalization
([#6739](https://github.com/elastic/eui/pull/6739))
- Updated `EuiFocusTrap` to support the `gapMode` prop configuration
(now defaults to `padding`)
([#6744](https://github.com/elastic/eui/pull/6744))

**Bug fixes**

- Fixed inconsistency in `EuiSearchBar`'s AND/OR semantics between DSL
and query string generation
([#6717](https://github.com/elastic/eui/pull/6717))
- Fixed `EuiFieldNumber`'s native browser validity detection causing
extra unnecessary rerenders
([#6741](https://github.com/elastic/eui/pull/6741))
- Fixed the `scrollLock` property on `EuiFocusTrap` (and other
components using `EuiFocusTrap`, such as `EuiFlyout` and `EuiModal`) to
no longer block scrolling on nested portalled content, such as combobox
dropdowns ([#6744](https://github.com/elastic/eui/pull/6744))

**Breaking changes**

- `EuiAvatar`s with the default `user` type will now default to
capitalizing all initials in uppercase
([#6739](https://github.com/elastic/eui/pull/6739))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-05-15 16:09:31 -05:00