Commit graph

145 commits

Author SHA1 Message Date
Walter Rafelsberger
dfcb1794d4
[ML] Transforms: Fix handling of fields with keyword mapping available (#98882)
- For groupby/agg configs, removes the .keyword postfix for the agg name and field name being displayed. The config itself will still use the field name including .keyword.
- For histogram charts, if available, query data using the .keyword field. This enables support for charts for terms when there's both a text and keyword variant.
- Fixes isKeywordDuplicate check for field names with multiple dots in them.
2021-05-04 16:21:27 +02:00
Walter Rafelsberger
763e08a1dd
[ML] Transforms/Data Frame Analytics: Fix data grid height. (#98923)
Adds a short term fix/override for the height of data grid in transform and data frame analytics wizards.
EUI itself sets the height style of euiDataGrid__virtualized. For some reason it's not able to adjust that height within the wizards when you toggle histogram visibility or change rows shown per page.
This PR fixes it by wrapping the data grid with EuiMutationObserver to listen for updates within the data grid and setting the height of euiDataGrid__virtualized to auto on every update. For now this should be a safe short term fix since we don't use the full screen option.
2021-05-03 16:55:00 +02:00
Walter Rafelsberger
5793719b13
[ML] Align transform id validation with regexp used in ES code. (#98783)
Fixes isTransformIdValid() to use the same RegExp used in Elasticsearch's transform code.
2021-04-30 12:42:48 +02:00
Walter Rafelsberger
42d361c644
[ML] Adds waiting state for transforms. (#98592)
When no transform nodes are available, existing continuous transform end up in a waiting state. This PR adds support for this state in the transforms UI. Without the fix, transforms in a waiting state would fail to show up in the transform list.
2021-04-29 10:17:22 +02:00
Walter Rafelsberger
639f8290ff
Transforms/Data Frame Analytics: Fix populated fields sorting used for data grid columns. (#98596)
Missed sorting the columns ids based on populated fields. If not all fields are populated in all documents equally, this could result in not correctly sorted columns, also resulting in flaky tests.
2021-04-28 16:22:33 +02:00
Walter Rafelsberger
bfb363f050
[ML] Transforms/Data Frame Analytics: Fix freezing wizard for indices with massive amounts of fields. (#98259)
The transform wizard can become very slow when used with indices with e.g. 1000+ fields.

This PR fixes it by prefetching 500 random documents to create a list of populated/used fields and passes those on to the data grid component instead of all available fields from the list derived via Kibana index patterns.

For example, for an out of the box metricbeat index, this reduces the list of passed on fields from 3000+ to ~120 fields. Previously, the page would freeze on load for tens of seconds and would freeze again on every rerender. With the applied update, the page loads almost instantly again and remains responsive.

Note this fix of reducing available fields is only applied to the data grid preview component. All fields are still available to create the configuration in the UI for groups and aggregations. These UI components, e.g. the virtualized dropdowns, can handle large lists of fields.
2021-04-28 08:23:07 +02:00
Walter Rafelsberger
18d9d435af
[ML] Transforms: Adds a link to discover from the transform list to the actions menu. (#97805)
Adds a link to discover from the transform list to the actions menu. Conditions for the link to be enabled:
- Kibana index pattern must be available
- Transform must have been started once and done some progress so there's the destination index available
2021-04-27 10:49:20 -04:00
Melissa Alvarez
0a0fd695d3
[ML][Transform] display script_exception compile error message in wizards (#97697)
* ensure error rootCause script gets added to message

* ensure script part of error is shown in DFA wizard

* use isPopulatedObject to check for script field
2021-04-21 17:52:07 -04:00
Quynh Nguyen
71e8118984
[ML] Fix runtime mapping texts to runtime fields, add transform switch modal (#97008) 2021-04-19 13:46:18 -05:00
Dima Arnautov
d9ef5c28d5
[ML] Fix switches positioning on the Transform and DFA wizards (#96535)
* [ML] fix edit runtime mapping switch positioning

* [ML] fix transform wizard switches
2021-04-08 07:10:52 -04:00
Walter Rafelsberger
f945f3a425
[ML] Transforms: Wizard displays warning callout for source preview when used with CCS against clusters below 7.10. (#96297)
The transforms UI source preview uses fields to search and retrieve document attributes. The feature was introduced in 7.10. For cross cluster search, as of now, when a search using fields is used using cross cluster search against a cluster earlier than 7.10, the API won't return an error or other information but just silently drop the fields attribute and return empty hits without field attributes.

In Kibana, index patterns can be set up to use cross cluster search using the pattern <cluster-names>:<pattern>. If we identify such a pattern and the search hits don't include fields attributes, we display a warning callout from now on.
2021-04-07 16:39:11 +02:00
Quynh Nguyen
8051fa91d8
[ML] Fix runtime mappings not copy-able in Transform wizard (#95996)
* [ML] Fix transform runtime mappings not copy-able

* [ML] Fix histogram not updating after change

* [ML] Fix isRuntimeMappings imports

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-06 15:47:58 -05:00
Mikhail Shustov
e457f212c4
Revert "TS Incremental build exclude test files (#95610)" (#96223)
This reverts commit b6e582c53e.
2021-04-05 11:59:26 -07:00
Mikhail Shustov
b6e582c53e
TS Incremental build exclude test files (#95610)
* add base config for all the TS projects

* all the project use new tsconfig.project.json

* compile test files in the high-level tsconfig.json

* fix TS error in maps plugin

* fix TS error in infra plugin

* exclude mote test and test until folders

* uptime. do not import test code within prod code

* expressions. do not import test code within prod code

* data: export mocks from high level folder

* task_manager: comply with es client typings

* infra: remove unused enzyme_helpers

* check_ts_project requires "include" key

* ts_check should handle parent configs

* all ts configs should extend base one

* exclude test folders from plugins

* update patterns to fix ts_check errors

* Apply suggestions from code review

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* uptime: MountWithReduxProvider to test helpers

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-04-01 14:40:47 +02:00
Walter Rafelsberger
a1c36e7a06
[ML] Refactor imports using 'elasticsearch' to '@elastic/elasticsearch'. Extend 'isPopulatedOjbect()'. (#95651)
- Gets rid of imports from 'elasticsearch' and replaces them with '@elastic/elasticsearch'.
- Extends isPopulatedObject() to allow an optional array of attributes to check if they exist. Allows us to get rid of the manual and inconsistent usages of hasOwnProperty().
2021-04-01 11:46:17 +02:00
Quynh Nguyen
f061303282
[ML] Fix Transform runtime mappings retain original definition when cloning (#95436)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-26 10:25:39 -05:00
Tomas Della Vedova
238791b942
ES client : use the new type definitions (#83808)
* Use client from branch

* Get type checking working in core

* Fix types in other plugins

* Update client types + remove type errors from core

* migrate Task Manager Elasticsearch typing from legacy library to client library

* use SortOrder instead o string in alerts

* Update client types + fix core type issues

* fix maps ts errors

* Update Lens types

* Convert Search Profiler body from a string to an object to conform to SearchRequest type.

* Fix SOT types

* Fix/mute Security/Spaces plugins type errors.

* Fix bootstrap types

* Fix painless_lab

* corrected es typing in Event Log

* Use new types from client for inferred search responses

* Latest type defs

* Integrate latest type defs for APM/UX

* fix core errors

* fix telemetry errors

* fix canvas errors

* fix data_enhanced errors

* fix event_log errors

* mute lens errors

* fix or mute maps errors

* fix reporting errors

* fix security errors

* mute errors in task_manager

* fix errors in telemetry_collection_xpack

* fix errors in data plugins

* fix errors in alerts

* mute errors in index_management

* fix task_manager errors

* mute or fix lens errors

* fix upgrade_assistant errors

* fix or mute errors in index_lifecycle_management

* fix discover errors

* fix core tests

* ML changes

* fix core type errors

* mute error in kbn-es-archiver

* fix error in data plugin

* fix error in telemetry plugin

* fix error in discover

* fix discover errors

* fix errors in task_manager

* fix security errors

* fix wrong conflict resolution

* address errors with upstream code

* update deps to the last commit

* remove outdated comments

* fix core errors

* fix errors after update

* adding more expect errors to ML

* pull the lastest changes

* fix core errors

* fix errors in infra plugin

* fix errors in uptime plugin

* fix errors in ml

* fix errors in xpack telemetry

* fix or mute errors in transform

* fix errors in upgrade assistant

* fix or mute fleet errors

* start fixing apm errors

* fix errors in osquery

* fix telemetry tests

* core cleanup

* fix asMutableArray imports

* cleanup

* data_enhanced cleanup

* cleanup events_log

* cleaup

* fix error in kbn-es-archiver

* fix errors in kbn-es-archiver

* fix errors in kbn-es-archiver

* fix ES typings for Hit

* fix SO

* fix actions plugin

* fix fleet

* fix maps

* fix stack_alerts

* fix eslint problems

* fix event_log unit tests

* fix failures in data_enhanced tests

* fix test failure in kbn-es-archiver

* fix test failures in index_pattern_management

* fixing ML test

* remove outdated comment in kbn-es-archiver

* fix error type in ml

* fix eslint errors in osquery plugin

* fix runtime error in infra plugin

* revert changes to event_log cluser exist check

* fix eslint error in osquery

* fixing ML endpoint argument types

* fx types

* Update api-extractor docs

* attempt fix for ese test

* Fix lint error

* Fix types for ts refs

* Fix data_enhanced unit test

* fix lens types

* generate docs

* Fix a number of type issues in monitoring and ml

* fix triggers_actions_ui

* Fix ILM functional test

* Put search.d.ts typings back

* fix data plugin

* Update typings in typings/elasticsearch

* Update snapshots

* mute errors in task_manager

* mute fleet errors

* lens. remove unnecessary ts-expect-errors

* fix errors in stack_alerts

* mute errors in osquery

* fix errors in security_solution

* fix errors in lists

* fix errors in cases

* mute errors in search_examples

* use KibanaClient to enforce promise-based API

* fix errors in test/ folder

* update comment

* fix errors in x-pack/test folder

* fix errors in ml plugin

* fix optional fields in ml api_integartoon tests

* fix another casting problem in ml tests

* fix another ml test failure

* fix fleet problem after conflict resolution

* rollback changes in security_solution. trying to fix test

* Update type for discover rows

* uncomment runtime_mappings as its outdated

* address comments from Wylie

* remove eslint error due to any

* mute error due to incompatibility

* Apply suggestions from code review

Co-authored-by: John Schulz <github.com@jfsiii.org>

* fix type error in lens tests

* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* Update x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts

Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>

* update deps

* fix errors in core types

* fix errors for the new elastic/elasticsearch version

* remove unused type

* remove unnecessary manual type cast and put optional chaining back

* ML: mute Datafeed is missing indices_options

* Apply suggestions from code review

Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>

* use canary pacakge instead of git commit

Co-authored-by: Josh Dover <me@joshdover.com>
Co-authored-by: Josh Dover <1813008+joshdover@users.noreply.github.com>
Co-authored-by: Gidi Meir Morris <github@gidi.io>
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
Co-authored-by: Wylie Conlon <wylieconlon@gmail.com>
Co-authored-by: CJ Cenizal <cj@cenizal.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: restrry <restrry@gmail.com>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
Co-authored-by: John Schulz <github.com@jfsiii.org>
Co-authored-by: Alison Goryachev <alisonmllr20@gmail.com>
2021-03-25 04:47:16 -04:00
Quynh Nguyen
07a041ab3a
[ML] Fix Transform runtime mapping editor so mappings can be removed (#95108)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-24 13:28:31 -05:00
Walter Rafelsberger
dd7ea1d4b2
[ML] Data Frame Analytics: Fix ROC Curve Chart for binary classification. (#94791)
- Updates the ROC Curve Chart to show only one line for binary classification.
- Improves type specs for the evaluate panel's data.
2021-03-20 18:41:25 +01:00
Walter Rafelsberger
f3b74b457c
[ML] Transforms: Fixes missing number of transform nodes and error reporting in stats bar. (#93956)
- Adds a Kibana API endpoint transforms/_nodes
- Adds number of nodes to the stats bar in the transforms list.
- Shows a callout when no transform nodes are available.
- Disable all actions except delete when no transform nodes are available.
- Disables the create button when no transform nodes are available.
2021-03-16 11:41:48 +01:00
Lisa Cawley
fb199e3584
[ML] Add latest transform to intro text (#94039) 2021-03-10 13:01:12 -08:00
Walter Rafelsberger
066e47e9ea
[ML] Use unknown instead of any for type guards. (#94090) 2021-03-10 12:40:49 +01:00
Quynh Nguyen
fcf397f9c3
[ML] Add functional tests for runtime mappings in Transforms (#92738)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-09 11:25:58 -06:00
Walter Rafelsberger
326dfa43ca
[ML] Improves error handling for transform wizard when Kibana index pattern or saved search fails to load. (#93915)
Improves error handling for the transform wizard when Kibana index pattern or saved search fails to load.
Previously a non-existing index pattern or saved search or corrupt saved object could cause the page to end up blank. Improved error reporting will catch the problem and display an error callout.
2021-03-09 15:29:45 +01:00
Pete Harverson
be0b444873
[ML] Transforms: Adds a11y tests for Transform plugin (#93197) 2021-03-03 11:41:44 +00:00
Walter Rafelsberger
8201d4fd01
[ML] Transforms: Fixes chart histograms for runtime fields. (#93028)
Fixes chart histograms for runtime fields. The runtime field configurations were not passed on to the endpoint to fetch the charts data, so charts ended up being empty with a 0 documents legend.
2021-03-02 13:37:29 +01:00
Quynh Nguyen
96e34d96b1
[ML] Add functional tests for Transform start/delete (#92314) 2021-02-24 12:10:04 -06:00
Walter Rafelsberger
45155f089d
[ML] Show mini histograms by default if row count below threshold. (#92021)
Show mini histograms by default if row count below threshold of 10000 docs.
2021-02-23 17:34:59 +01:00
Walter Rafelsberger
2bb2629fec
[ML] Transforms: Adds missing bucket checkbox to group by popover form. (#91650)
Adds missing bucket checkbox to group by popover form.
2021-02-18 01:54:39 +01:00
Quynh Nguyen
7a75e19c3e
[ML] Fix runtime mappings for runtimeField with optional script field (#91634) 2021-02-17 09:40:49 -06:00
Walter Rafelsberger
d24504fa33
[ML] Fix applying missing_bucket config to request payload. (#91635)
The configuration for missing_bucket was applied on the wrong level of the nested JSON config object. This PR fixes both code and tests to cover the correct application.
2021-02-17 10:17:09 -05:00
Quynh Nguyen
63ac0f74be
[ML] Add better UI support for runtime fields Transforms (#90363)
* [ML] Add RT support for transforms from index pattern

* [ML] Add support for cloned transform from api

* [ML] Add support for runtime pivot

* [ML] Add support for api created runtime

* [ML] Add preview for expanded row

* [ML] Add runtime fields to dropdown options

* [ML] Add runtime fields to latest

* [ML] Fix duplicate columns

* [ML] Update types and test

* [ML] Add runtime mappings to index pattern on creation

* [ML] Add callout to show unsupported fields in dfa

* [ML] Update types to RuntimeField

* [ML] Fix runtime fields, remove runtime mappings, fix copy to console

* [ML] Fix incompatible kbn field type

* [ML] Add advanced mappings editor

* [ML] Add support for filter terms agg control

* [ML] Fix jest tests hanging

* [ML] Fix translations

* [ML] Fix over-sized buttons for filter range

* [ML] Update runtime mappings schema

* [ML] Update runtime mappings schema

* [ML] Use isRecord for object checks

* [ML] Fix and more message

* [ML] Update schema to correctly match types

* [ML] Update schema to correctly match types

* [ML] Fix pivot duplicates

* [ML] Rename isRecord to isPopulatedObject

* [ML] Remove fit-content

* [ML] Update runtime field type to prevent potential conflicts

* Revert "[ML] Remove fit-content"

This reverts commit 76c9c799

* [ML] Remove misc comment

* [ML] Fix missing typeof

* [ML] Add sorts and constants

* [ML] Add i18n to includedFields description

* [ML] fix imports

* [ML] Only pass runtime mappings if it's latest

* [ML] Fix functional tests
2021-02-16 20:00:02 -06:00
Walter Rafelsberger
073cd4d508
[ML] Transforms: Adds retention policy options to transform UI. (#91162)
Adds retention policy options to the transform UI.
2021-02-16 21:29:56 +01:00
Greg Thompson
8126488021
Upgrade EUI to v31.7.0 (#91210)
* eui to 31.6.0

* flyout, collapsible snapshot updates

* initial overlaymask removal

* undo jest

* overlaymask src snapshot updates

* more overlaymask removals

* overlaymask removal xpack test updates

* saved objects modal form

* eui to 31.7.0

* code, codeblock types

* snapshot update

* tooltip

* remove ownFocus from ConfirmModal

* remove fragments
2021-02-16 14:06:25 -06:00
Joe Portner
2ef468ef82
Fixes session idle timeout (#91070)
* Fix calls to `/api/saved_objects_tagging/tags`

Seen on all pages.

* Fix calls to `/api/ui_counters/_report`

Seen on all pages.

* Fix calls to `/api/index_management/indices/reload`

Seen on page: /app/management/data/index_management

* Fix calls to `/api/watcher/watches`

Seen on page: /app/management/insightsAndAlerting/watcher/watches

* Fix calls to `/api/rollup/jobs`

Seen on page: /app/management/data/rollup_jobs/job_list

* Fix calls to `/api/cross_cluster_replication/follower_indices`

Seen on page: /app/management/data/cross_cluster_replication/follower_indices

* Fix calls to `/api/cross_cluster_replication/auto_follow_patterns`

Seen on page: /app/management/data/cross_cluster_replication/auto_follow_patterns

* Fix calls to `/api/transform/transforms` and `/api/transform/transforms/_stats`

Seen on page: /app/management/data/transform

* Fix calls to `/api/console/proxy`

Seen on page: /app/dev_tools#/console

* Fix calls to `/api/monitoring/v1/clusters` and `/api/monitoring/v1/elasticsearch_settings/check/cluster`

Seen on page: /app/monitoring
2021-02-16 07:19:41 -05:00
Brandon Kobel
4584a8b570
Elastic License 2.0 (#90099)
* Updating everything except the license headers themselves

* Applying ESLint rules

* Manually replacing the stragglers
2021-02-03 18:12:39 -08:00
Pete Harverson
87e83860ce
[ML] Transforms: Migrates transform plugin to TS project ref (#90190) 2021-02-03 17:14:03 +00:00
Walter Rafelsberger
922abfa21e
[ML] Transforms: Fixes available fields for sort options for latest configuration (#88617)
- Fixes the transform preview header to display the heading text in any case and the copy-to-clipboard button for latest configurations (the copy-to-clipboard option for pivot is displayed within the form).
- Fix to avoid listing all fields for the sort option for latest configuration and only show date fields
- Fixes ambiguous form field labels
2021-01-21 08:11:59 +01:00
Jonathan Budzenski
51ba94d3e5
[dev] Replace sass-lint with stylelint (#86177)
Co-authored-by: Tyler Smalley <tylersmalley@me.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dave Snider <dave.snider@gmail.com>
2021-01-15 11:52:29 -06:00
Dima Arnautov
1f131b250f
[Transform] Functional tests for latest method (#86966)
* [ML] create latest transform from index pattern

* [Transform] refactor, tests for saved search

* [Transform] cloning tests for latest transform

* [Transform] fix cloning test, add editing tests

* [Transform] fix typo

* [Transform] disable cloning tests

* [Transform] add assertion for selected tranform function

* [Transform] disable editing tests

* [Transform] disable editing and cloning tests for latest function
2021-01-13 10:05:05 +01:00
Dima Arnautov
83e8fe8ef0
[Transform] Show destination index mapping warning for the latest transform (#87858)
* [Transform] show callout for the latest transform

* [Transform] fix flex styles

* [Transform] change to vertical layout, update warning message

* [Transform] fix messages
2021-01-12 13:03:47 +01:00
Dima Arnautov
1d49166203
[Transform] Fix transform preview for the latest function (#87168)
* [Transform] retrieve mappings from the source index

* [Transform] fix preview for nested props

* [Transform] exclude meta fields

* [Transform] use agg config to only suggest term agg supported fields

* [Transform] refactor

* [Transform] remove incorrect data mock

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-01-07 00:28:05 +01:00
Lisa Cawley
28e60d47ad
[ML] Use doc links service for transforms (#86919) 2021-01-04 09:59:18 -08:00
Thomas Watson
e8b21bc6c1
Upgrade to hapi version 20 (#85406) 2020-12-19 13:10:11 +01:00
Dima Arnautov
e17cd65196
[Transform] Add support for latest function (#85784)
* [Transform] add latest to the schema definition

* [ML] update interfaces, add guards

* [Transform] WIP support latest function

* [Transform] fix request with missing_bucket after merge

* [Transform] fix error in useDeleteTransforms

* [Transform] fix types and fields sorting for pivot

* [Transform] fix types and jest tests

* [Transform] fix error shape

* [Transform] fixed card width, change description

* [Transform] fixed API integration tests

* [Transform] fix config mapper

* [Transform] improve wizard performance
2020-12-15 22:40:13 +01:00
Tyler Smalley
504c8739de
test:jest improvements to better support our monorepo (#84848)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-14 14:07:50 -08:00
Walter Rafelsberger
a6e6b62658
[ML] Transforms: Support for missing_bucket in transform advanced pivot editor (#85758)
Adds support for missing_bucket with group-by configurations in the advanced editor for pivot configurations.
Previously, the editor would allow you to add the setting, but it would be stripped from the config once the transform gets created.
2020-12-14 17:51:18 +01:00
Dima Arnautov
58fc711626
[Transform] Replace legacy elasticsearch client (#84932)
* [Transform] replace legacy elasticsearch client

* [Transform] delete custom legacy client definition, update transforms_audit_messages.ts

* [Transform] fix start and stop transform endpoints

* [Transform] fix privileges and stats endpoints

* [Transform] fix forbidden

* [Transform] revert continue statement, add a comment

* [Transform] update privileges.ts using security namespace

* [Transform] fix error wrappers

* [Transform] add functional test for preview error validation

* [Transform] extract error message from the root cause

* [Transform] remove error translation
2020-12-09 12:55:54 +01:00
Tyler Smalley
b593781009
Jest multi-project configuration (#77894)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-02 11:42:23 -08:00
Mikhail Shustov
95861a0fb0
[DX] Prettier v2.2 (#83899)
* update prettier with ts version support

* mute type-error

* run prettier on codebase

* fix examples

* fix errors after master merged
2020-11-23 13:17:05 +01:00