Commit graph

270 commits

Author SHA1 Message Date
Dima Arnautov
3002108c40
[ML] rename inference to trained_models (#79676) 2020-10-06 19:31:59 +02:00
Melissa Alvarez
9794188cbf
ensure missing indexPattern error is bubbled up to error callout (#79378) 2020-10-06 09:39:42 -04:00
Dima Arnautov
6caf6d5080
[ML] Model management UI fixes and enhancements (#79072)
* [ML] link to edit pipeline

* [ML] view training data link

* [ML] format stats and configs

* [ML] refactor date_utils

* [ML] fix types

* [ML] change "View" icon and label

* [ML] revert label change
2020-10-01 17:54:56 +02:00
Quynh Nguyen
31efa1ab5b
[ML] Add feature importance summary charts (#78238)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-10-01 09:39:17 -05:00
Quynh Nguyen
2344dcfae8
[ML] Migrate machine learning URLs to BrowserRouter format for APM, Security, and Infra (#78209)
* [ML] Adds ability to pass multiple jobIds to job management url

* [ML][APM] Update links to jobs management page for MLLink and LegacyJobsCallout

* [ML][APM] Update useTimeSeriesExplorerHref

* [ML][APM] Update tests

* [ML][APM] Move test from useTimeSeriesExplorerHref to MLJobLink.test.tsx

* [ML][Infra] Update ML links in infra to non-hash paths

* [ML] Move MlUrlGenerator registration outside of licensing block for security solution

* [ML][Security] Update ml links in security

* [ML][APM] Update test snapshots

* [ML][APM] Update snapshots

* [ML][Security solution] Update tests

* [ML] Update MLLink to include globalState

* [ML] Update useTimeSeriesExplorerHref

* [ML] Update apm and security_solution to use useMlHref hook

* [ML] Update APM to use useUrlParams hook, update security solution hook

* [ML] Update tests, fix duplicate imports

* [ML] Update imports, remove ml exports to shared cause it's not needed

[ML] Add import

* [ML] Update snapshot

* [ML] Fix warnings for jobs_table.test.tsx

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-30 18:53:17 -05:00
James Gowdy
c4f05c4758
[ML] Fixing module datafeed overrides (#78925) 2020-09-30 18:27:03 +01:00
Walter Rafelsberger
61aac716b3
[ML] Limit exposing shared static code through ml/public/index.ts. (#77745)
- Clean up lodash imports.
- Import types only where applicable.
- Reduce page load bundle size by fetching more code asynchronously.
2020-09-29 11:57:53 +02:00
Melissa Alvarez
25682bf7ce
[ML]DF Analytics exploration: default filter of results page by defaultIsTraining value in url (#78303)
* df exploration page: handle default isTraining filter in url

* default training query updated to match what the searchBar would produce. fixes evaluate panel dataset label

* clear defaultIsTraining filter from url once applied
2020-09-28 15:13:20 -04:00
Brittany Joiner
63ce752dc2
Adding comment about importing lodash library (#78156)
* added comment about importing lodash library

* fixed space with prefer

* cleaned up extra space and removed comments for lodash/fp

* took out the comment in server files

* Remove newlines

Co-authored-by: Nathan L Smith <smith@nlsmith.com>
2020-09-24 11:38:11 -05:00
Nathan Reese
f3c9d10afc
[ML] add geo point combined field to CSV import (#77117)
* [ML] add geo point combined field to CSV import

* remove some geo_point specific logic

* Account for properties layer in find_file_structure mappings

* improve checking of name collision to include combined fields and mappings

* add delete button

* fix function name

* fill in unknowns with defined types

* tslint changes

* get tslint passing

* show readonly combined fields in simple tab

* handle column_names being undefined

* add unit tests for modifying mappings and pipeline

* review feedback

* do not change combinedFields on reset

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-18 10:21:52 -06:00
Dario Gieselaar
217276e8a9
[APM] Align APM severity levels with ML (#77818) 2020-09-18 14:02:37 +02:00
Quynh Nguyen
d88b3a6dde
[ML] Migrate internal urls to non-hash paths (#76735)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-17 12:09:08 -05:00
Michail Yasonik
61c4e6fd8d
Stacked headers and navigational search (#72331)
Co-authored-by: Poff Poffenberger <poffdeluxe@gmail.com>
Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: cchaos <caroline.horn@elastic.co>
2020-09-14 14:32:30 -05:00
Walter Rafelsberger
dd1822047c
[ML] Transforms: API schemas and integration tests (#75164)
- Adds schema definitions to transform API endpoints and adds API integration tests.
- The type definitions based on the schema definitions can be used on the client side too.
- Adds apidoc documentation.
2020-09-14 16:31:23 +02:00
Larry Gregory
2e34eb239f
Hide management sections based on cluster/index privileges (#67791)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-14 09:30:47 -04:00
James Gowdy
ea8086b3f2
[ML] Improving client side error handling (#76743)
* [ML] Improving client side error handling

* adding stacktrace to request errors

* copying error parsing to transforms

* update snapshot

* fixing jest tests

* adding test and removing debug log output

* updating translations

* rewriting error extracting code

* fixing tests

* removing message bar service

* removing test code

* updating translations

* combining job creation error handling

* refactoring error files

* updating test

* fixing bug in DFA deletion

* improving mml warning

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-11 08:53:34 +01:00
Quynh Nguyen
619108cac3
[ML] Add decision path charts to exploration results table (#73561)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-09 11:41:52 -05:00
David Roberts
c7dac8000c
[ML] Account for "properties" layer in find_file_structure mappings (#77035)
This is the UI side companion for elastic/elasticsearch#62158

Previously the "mappings" field of the response from the
find_file_structure endpoint was not a drop-in for the
mappings format of the create index endpoint - the
"properties" layer was missing. The reason for omitting
it initially was that the assumption was that the
find_file_structure endpoint would only ever return very
simple mappings without any nested objects. However,
this will not be true in the future, as we will improve
mappings detection for complex JSON objects. As a first
step it makes sense to move the returned mappings closer
to the standard format.
2020-09-09 16:31:09 +01:00
Pete Harverson
a0495090c0
[ML] Replace all use of date_histogram interval with fixed_interval (#76876)
* [ML] Replace all use of date_histogram interval with fixed_interval

* [ML] Fix data visualizer API test
2020-09-09 14:49:22 +01:00
Melissa Alvarez
8bc6898c33
[ML] DF Analytics models list: persist pagination through refresh interval (#76695)
* ensure wizard error shows up correctly

* wip: switch to basic table for model management

* add selection and multi job action to models list

* update error extraction function

* use generic types in hook

* simplify filtered items
2020-09-08 13:57:10 -04:00
Quynh Nguyen
ee3c8d081a
[ML] Add option to Advanced Settings to set default time range filter for AD jobs (#76347) 2020-09-04 11:46:17 -05:00
Quynh Nguyen
aac84240b2
[ML] Extend MlUrlGenerator to support other ML pages (#75696)
Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
2020-09-02 14:52:10 -05:00
Mikhail Shustov
37ec1e1053
Update to TS v4 (#73924)
* bump ts to v4

* MOAR RAM

* fix type errors for OSS

* first pass on x-pack errors

* second pass on x-pack type errors

* 3rd pass on x-pack type-errors

* mute errors if complex cases

* don't delete if spread suffices

* mute other complex cases

* make User fields optional

* fix optional types

* fix tests

* fix typings for time_range

* fix type errors in x-pack/tests

* rebuild kbn-pm

* remove leftovers from master update

* fix alert tests

* [Telemetry Checker] TS4 Fixes

* bump to 4.0.1-rc

* fix new errors in master

* bump typescript-eslint to version supporting TS v4 syntax

* fix merge commit errors

* update to the stable TS version 4.0.2

* bump ts-eslint to version supporting ts v4

* fix typo

* fix type errors after merge

* update ts in another new package.json

* TEMP: remove me

* Revert "TEMP: remove me"

This reverts commit dc0fc3bae6.

* [Telemetry] Update snapshot for new TS4 SyntaxKind

* bump prettier to support TS v4 syntax

* fix prettier rules

* last style change

* fix new type errors

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2020-08-27 10:28:02 +02:00
Catherine Liu
532f2d70e8
[Home] Elastic home page redesign (#70571)
Co-authored-by: Catherine Liu <catherine.liu@elastic.co>
Co-authored-by: Ryan Keairns <contactryank@gmail.com>
Co-authored-by: Catherine Liu <catherineqliu@outlook.com>
Co-authored-by: Michael Marcialis <michael.marcialis@elastic.co>
2020-08-26 13:00:00 -07:00
Quynh Nguyen
3469e164f4
[ML] Add option for per-partition categorization to categorization job wizard (#75061) 2020-08-19 13:03:00 -05:00
Dima Arnautov
8f7d213944
[ML] Inference models management (#74978)
* [ML] init tabs

* [ML] init inference API service in UI

* [ML] server-side routes

* [ML] basic table

* [ML] support deletion

* [ML] delete multiple models

* [ML] WIP expanded row

* [ML] fix types

* [ML] expanded row

* [ML] fix types

* [ML] fix i18n id

* [ML] change server-side permission check

* [ML] refactor types

* [ML] show success toast on model deletion, fix models counter

* [ML] update expanded row

* [ML] pipelines stats

* [ML] use refresh observable

* [ML] endpoint to fetch associated pipelines

* [ML] update the endpoint to fetch associated pipelines

* [ML] show pipelines definition in expanded row

* [ML] change stats layout

* [ML] fix headers

* [ML] change breadcrumb title

* [ML] fetch models config with pipelines

* [ML] change default size to 1000

* [ML] fix collections keys, fix double fetch on initial page load

* [ML] adjust models deletion text

* [ML] fix DFA jobs on the management page

* [ML] small tabs in expanded row

* [ML] fix headers text

* [ML] fix models fetching without pipelines get permissions

* [ML] stats rendering as a description list

* [ML] fix i18n id

* [ML] remove an extra copyright comment, add selectable messages

* [ML] update stats on refresh
2020-08-19 16:22:26 +02:00
Walter Rafelsberger
2559d90551
[ML] Anomaly Explorer / Single Metric Viewer: Fix error reporting for annotations. (#74953)
Fixes error reporting when annotations fail to load for Anomaly Explorer and Single Metric Viewer.
Previously, Anomaly Explorer ended up with a completely empty page when annotations failed to load. Single Metric Viewer would not fail to load, but it would make no difference for the user if existing annotations failed to load of if there were simply no existing annotations. Only in dev console an error message would be visible.
Now a callout is shown when annotations fail to load.
2020-08-19 12:07:15 +02:00
Ryland Herrick
4ca52e678a
[Security Solution][Detections] Refactor ML calls for newest ML permissions (#74582)
## Summary

Addresses https://github.com/elastic/kibana/issues/73567.

ML Users (role: `machine_learning_user`) were previously able to invoke the ML Recognizer API, which we use to get not-yet-installed ML Jobs relevant to our index patterns. As of https://github.com/elastic/kibana/pull/64662 this is not true, and so we receive errors from components using the underlying hook, `useSiemJobs`.

To solve this I've created two separate hooks to replace `useSiemJobs`:

* `useSecurityJobs`
  * used on ML Popover
  * includes uninstalled ML Jobs
  * checks (and returns) `isMlAdmin` before fetching data
* `useInstalledSecurityJobs`
  * used on ML Jobs Dropdown and Anomalies Table
  * includes only installed ML Jobs
  * checks (and returns) `isMlUser` before fetching data

Note that we while we now receive the knowledge to do so, we do not always inform the user in the case of invalid permissions, and instead have the following behaviors:

#### User has insufficient license
* ML Popover:  shows an upgrade CTA
* Anomalies Tables: show no data
* Rule Creation: ML Rule option is disabled, shows upgrade CTA
* Rule Details: ML Job Id is displayed as text
#### User is ML User
* ML Popover:  not shown
* Anomalies Tables: show no data
* Rule Creation: ML Rule option is disabled
* Rule Details: ML Job Id is displayed as text
#### User is ML Admin
* ML Popover:  shown
* Anomalies Tables: show data __for installed ML Jobs__
  * This is the same as previous logic, but worth calling out that you can't view historical anomalies
* Rule Creation: ML Rule option is enabled, all ML Jobs available
* Rule Details: ML Job Id is displayed as hyperlink, job status badge shown

### Checklist

- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-08-12 18:26:06 -06:00
James Gowdy
a81059b14b
[ML] Removing full lodash library imports (#74742)
* [ML] Removing full lodash library imports

* more has

* fixing missing filter

* removing _

* removing unused file

* removing first use

* removing comment
2020-08-12 09:24:43 +01:00
James Gowdy
10cbaf5ca1
[ML] Disabling ML if license feature is disabled (#73187)
* [ML] Disabling ML if license feature is disabled

* disabling UI feature

* removing unused import

* small refactor

* disabling ml using plugin updater

* function rename

* update comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-29 16:45:32 +01:00
Larry Gregory
09b11b61f0
Introduce reserved ml privilege for the apm_user role (#72266)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-28 07:44:37 -04:00
James Gowdy
18df677da7
[ML] Fixing file import, module creation and results viewing permission checks (#72825)
* [ML] Fixing file import and module creation permission checks

* correcting searches on results index

* fixing test

* removing unnecessary index

* updating apidoc

* fixing test

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-23 16:11:15 +01:00
James Gowdy
fbf41e5379
[ML] Handling data recognizer saved object errors (#72447)
* [ML] Handling data recognizer saved object errors

* adding text for unknown errors

* fixing typos
2020-07-21 14:28:10 +01:00
Quynh Nguyen
7868a569eb
[ML] Fix datafeed start time is incorrect when the job has trailing empty buckets (#71976)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-16 14:42:34 -05:00
Pete Harverson
6e30ce1ff2
[ML] Fix error toasts shown when starting or editing jobs (#71618)
* [ML] Fix error toasts shown when starting or editing jobs

* [ML] Adds toast_notification_service.ts file

* [ML] Fix Jest and type_check tests

* [ML] Alter check for statusCode in error object handling

* [ML] Fix errors Jest test
2020-07-14 19:45:10 +01:00
Quynh Nguyen
c24f180391
[ML] Anomaly Detection: Annotations enhancements (#70198)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-14 12:36:01 -05:00
James Gowdy
a1e511a727
[ML] Changing all calls to ML endpoints to use internal user (#70487)
* [ML] Changing all calls to ML endpoints to use internal user

* updating alerting

* updating documentation

* [ML] Changing all calls to ML endpoints to use internal user

* updating alerting

* updating documentation

* fixing missed types

* adding authorization headers to endpoint calls

* correcting has privileges call

* updating security tests

* odd eslint error

* adding auth header to module setup

* fixing missing auth argument

* fixing delete DFA job permission checks

* removing debug test tag

* removing additional ml privilege checks

* adding authorization header to _evaluate

* updating alerting cluster client name

* code clean up

* changing authorizationHeader name

* updating alterting documentation

* fixing secondary credentials

* adding management links

* updating SIEM telemetry

* fixing merge conflicts

* granting access to index patterns

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-14 15:48:24 +01:00
Walter Rafelsberger
262e0754ff
[ML] Kibana API endpoint for histogram chart data (#70976)
- Introduces dedicated Kibana API endpoints as part of ML and transform plugin API endpoints and moves the logic to query and transform the required data from client to server.
- Adds support for sampling to retrieve the data for the field histograms. For now this is not configurable by the end user and is hard coded to 5000. This is to have a first iteration of this functionality in for 7.9 and protect users when querying large clusters. The button to enable the histogram charts now includes a tooltip that mentions the sampler.
2020-07-14 13:37:36 +02:00
Walter Rafelsberger
fc62f4fee0
[ML] string_utils cleanup. (#71092)
- Converts string_utils to TypeScript.
- Removes sortByKey() from string_utils, we no longer make use of it.
- Fixes #69499, stringMatch() was defined twice, now moved to string_utils.
- Fixes #69498, OMIT_FIELDS was defined twice, now moved to common/constants/field_types.ts.
2020-07-09 16:26:45 +02:00
Quynh Nguyen
cf3133a5df
[ML] Add switch to enable model plot annotations independently (#70678) 2020-07-09 09:15:57 -05:00
Søren Louv-Jansen
58cdbf0fe6
[APM] Add warning to notify user about legacy ML jobs (#71030) 2020-07-09 08:45:13 +02:00
Oliver Gupte
7d44d022c9
[APM] Adds 'Anomaly detection' settings page to create ML jobs per environment (#70560)
* Adds 'Anomaly detection' settings page along with require API endpoints
to list and create the apm anomaly detection jobs per environment.
Some test data is hardcoded while the the required changes in the ML
plugin are in flight.

* Converts the environment name to a compatible ML id string and persist
in groups array. Also adds random token to the job ID to prevent
collisions for job ids where diffferent environment names convert to the
same string

* - Improve job creation with latest updates for the `apm_transaction` ML module
- Implements job list in settings by reading from `custom_settings.job_tags['service.environment']`
- Add ML module method `createModuleItem` for job configuration
- Don't allow user to type in duplicate environments

* Update x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/add_environments.tsx

Co-authored-by: Casper Hübertz <casper@formgeist.com>

* Update x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/index.tsx

Co-authored-by: Casper Hübertz <casper@formgeist.com>

* UX feedback, adds i18n, and handles failed state for ML jobs fetch.

* - Moves get_all_environments from agent_configuration dir to common dir
- makes the 'all' environment name ALL_OPTION_VALUE agent configuration-specific
- replace field literals with constants

* PR feedback

* Adds support to create jobs for environment which are not defined.

* Fixes description copy, rearranges settings links, and makes sure the 'Not defined' option is disabled if it already exists.

* Only show "Not defined" in environment selector if there are actually
documents without service.environment set

* get the indexPatternName for the ML job from the set of user-definned indices

* updated job_tags type definition

Co-authored-by: Casper Hübertz <casper@formgeist.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-07 13:30:14 +02:00
James Gowdy
f18002c3cd
[ML] Adding peak_model_bytes to model size stats type (#70825)
* [ML] Adding peak_model_bytes to model size stats type

* adding formatter
2020-07-07 09:24:40 +01:00
Melissa Alvarez
a4340f0ece
[ML] DF Analytics: add ability to edit job for fields supported by API (#70489)
* wip: add edit action to dfanalytics table

* add update endpoint and edit flyout

* show success and error toasts. close flyout and refresh on success

* show permission message in edit action

* update types

* disable update button if mml not valid

* show error in toast, init values are config values

* fix undefined check for allow lazy start

* prevent update if mml is empty
2020-07-06 15:10:01 -04:00
James Gowdy
eafd2af6aa
[ML] Adding capabilities checks to shared functions (#70069)
* [ML] Adding capabilities checks to shared functions

* small refactor

* disabling capabilities checks for functions called by SIEM alerting

* testing git

* removing comment

* using constant for ml app id

* tiny type clean up

* removing check in ml_capabilities

* fixing types

* removing capabilities checks from ml_capabilities endpoint

* updating types

* better error handling

* improving capabilities check

* adding custom errors

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-01 17:45:36 +01:00
Pete Harverson
b270321ff3
[ML] Fixes anomaly chart and validation for one week bucket span (#69671)
* [ML] Fixes anomaly chart and validation for one week bucket span

* [ML] Fix interval Jest tests
2020-06-24 09:20:38 +01:00
Walter Rafelsberger
a489e5f0b1
[ML] Data Grid Histograms (#68359)
Adds support for histogram charts to data grid columns.
- Adds a toggle button to the data grid's header to enabled/disable column charts.
- When enabled, the charts get rendered as part of the data grid header.
- Histogram charts will get rendered for fields based on date, number, string and boolean.
2020-06-19 08:39:50 +02:00
James Gowdy
7a60f18ef9
[ML] Model snapshot management (#68182)
* [ML] Model snapshot management

* more updates

* adding calendar range

* updating layout

* multiple calendars

* moving calendar creator

* fixing chart issues

* fixing chart issues

* improving calendar rendering

* adding capabilities checks

* code clean up

* fixing end time argument type

* fix translations

* code clean up

* comments based on review

* changes based on review

* fixing include

* adding useMemo to theme function
2020-06-16 14:03:17 +01:00
Quynh Nguyen
5f3c3c0354
[ML] Transforms - Updated: Add ability to delete dest index & index pattern when deleting transform job (#68896) 2020-06-11 10:39:31 -05:00
Quynh Nguyen
3197a00e79
Revert "[ML] Transforms: Add ability to delete dest index & index pattern when deleting transform job" (#68793) 2020-06-10 12:02:52 -05:00