Commit graph

36091 commits

Author SHA1 Message Date
Nathan L Smith
c9bd1a335b
Add tsconfig for url_forwarding (#81177) (#81854)
Also add missing pieces to kibana_react, as a follow-up to #80992.

References #80508
References #81003
2020-10-27 18:21:45 -05:00
Lee Drengenberg
a2b4067d29
[7.x] move apps lower in tree, add metricbeat dashboard screenshot test (#79001) (#81851) 2020-10-27 17:47:21 -05:00
Ahmad Bamieh
bc629f6955
[7.x] [i18n] add get_kibana_translation_paths tests (#81624) (#81822)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-28 00:30:21 +02:00
Frank Hassanabad
7bacd32b68
[Security Solution] critical pref bug with browser fields reducer (#81830)
## Summary


How to test this performance issue? Ensure that you add extra mappings of mapping-test-1k-block-1, 2, 3,4, etc.. that I have included within your advanced settings like below to a Kibana space:

```ts
apm-*-transaction*, auditbeat-*, endgame-*, filebeat-*, logs-*, packetbeat-*, winlogbeat-*, mapping-test-1k-block-1, mapping-test-1k-block-2, mapping-test-1k-block-3, mapping-test-1k-block-4
```

<img width="1331" alt="Screen Shot 2020-10-26 at 11 35 12 AM" src="https://user-images.githubusercontent.com/1151048/97224071-3a904a00-1796-11eb-8870-6de35fc2f115.png">

Modify these lines to add manual perf lines like so for the before numbers:

file: x-pack/plugins/security_solution/public/common/containers/source/index.tsx
```ts
export const getBrowserFields = memoizeOne(
  (_title: string, fields: IndexField[]): BrowserFields => {
    console.time('getBrowserFields'); // Start time
    const value =
      fields && fields.length > 0
        ? fields.reduce<BrowserFields>(
            (accumulator: BrowserFields, field: IndexField) =>
              set([field.category, 'fields', field.name], field, accumulator),
            {}
          )
        : {};
    console.timeEnd('getBrowserFields'); // End time
    return value;
  },
  // Update the value only if _title has changed
  (newArgs, lastArgs) => newArgs[0] === lastArgs[0]
);
```

Then load any of the SIEM webpages or create a detection engine rule and change around your input indexes.

Perf of this before the fix is going to show up in your dev tools console output like this:

```ts
getBrowserFields: 7875.5009765625 ms
```

Now, checkout this branch and change the code to be like so for the perf test of the mutatious version for after:

file: x-pack/plugins/security_solution/public/common/containers/source/index.tsx
```ts
/**
 * HOT Code path where the fields can be 16087 in length or larger. This is
 * VERY mutatious on purpose to improve the performance of the transform.
 */
export const getBrowserFields = memoizeOne(
  (_title: string, fields: IndexField[]): BrowserFields => {
    console.time('getBrowserFields'); // Start time
    // Adds two dangerous casts to allow for mutations within this function
    type DangerCastForMutation = Record<string, {}>;
    type DangerCastForBrowserFieldsMutation = Record<
      string,
      Omit<BrowserField, 'fields'> & { fields: Record<string, BrowserField> }
    >;

    // We mutate this instead of using lodash/set to keep this as fast as possible
    const value = fields.reduce<DangerCastForBrowserFieldsMutation>((accumulator, field) => {
      if (accumulator[field.category] == null) {
        (accumulator as DangerCastForMutation)[field.category] = {};
      }
      if (accumulator[field.category].fields == null) {
        accumulator[field.category].fields = {};
      }
      if (accumulator[field.category].fields[field.name] == null) {
        (accumulator[field.category].fields as DangerCastForMutation)[field.name] = {};
      }
      accumulator[field.category].fields[field.name] = (field as unknown) as BrowserField;
      return accumulator;
    }, {});
    console.timeEnd('getBrowserFields'); // End time
    return value;
  },
  // Update the value only if _title has changed
  (newArgs, lastArgs) => newArgs[0] === lastArgs[0]
);
```

Re-load any and all pages and you should see this now:

```ts
getBrowserFields: 11.258056640625 ms
```

### Checklist

Delete any items that are not applicable to this PR.

- [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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 15:48:09 -06:00
Frank Hassanabad
bde6b59766
[Security Solutions][Detection Engine] Changes wording for threat matches and rules (#81334) (#81834)
## Summary

Changes the wording for threat matches and rules

cc @marrasherrier @MikePaquette @paulewing

Before:

<img width="1063" alt="Screen Shot 2020-10-21 at 8 52 44 AM" src="https://user-images.githubusercontent.com/1151048/96737354-ce1ee080-137a-11eb-973f-6a7d96f69117.png">

After:
<img width="1055" alt="Screen Shot 2020-10-26 at 10 10 17 PM" src="https://user-images.githubusercontent.com/1151048/97256235-1fdec500-17d8-11eb-8a8b-4adffd23dbdc.png">

### 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/master/packages/kbn-i18n/README.md)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 15:47:46 -06:00
Tyler Smalley
4155c1f320 skip flaky suite (#81853) 2020-10-27 14:22:36 -07:00
Robert Austin
84d924c206
[Security Solution] reduce optimizer limits (#80997) (#81809)
# Conflicts:
#	packages/kbn-optimizer/limits.yml
2020-10-27 17:14:25 -04:00
Nathan L Smith
53b4a3d39e
Use Storybook Controls instead of Knobs (#80705) (#81398)
* Change an example in embeddable to use controls instead of knobs
* Add controls to SyncBadge APM story
* Convert both to [CSF](https://storybook.js.org/docs/react/api/csf)
* Remove the Knobs addon from the default Storybook configuration

Do not remove the Knobs addon package, since Canvas is still using it and this does not change anything in Canvas.
2020-10-27 15:20:56 -05:00
Tyler Smalley
b73c39cc31 skip flaky suite (#81844) 2020-10-27 12:58:16 -07:00
Devon Thomson
a6436b1c2b
[Time to Visualize] Update Library Text with Call to Action (#81667) (#81807)
* Added call to action to unlink message
2020-10-27 15:36:06 -04:00
Gidi Meir Morris
fc04417d81
[Task Manager] adds basic observability into Task Manager's runtime operations (#77868) (#81808)
This PR adds an an internal monitoring mechanism in Task Manager which keep track of a variety of metrics and a health api endpoint which makes the monitored statistics accessible.
# Conflicts:
#	x-pack/test/plugin_api_integration/test_suites/task_manager/index.ts
2020-10-27 18:15:26 +00:00
Spencer
4267321681
[7.x] [ftr/menuToggle] provide helper for enhanced menu toggle handling (#81709) (#81800)
Co-authored-by: spalger <spalger@users.noreply.github.com>
# Conflicts:
#	test/functional/services/common/test_subjects.ts
2020-10-27 10:44:11 -07:00
Yuliia Naumenko
f3e6671d1e
Added functional test for alerts list filters by status, alert type and action type. Did a code refactoring and splitting for alerts tests. (#81422) (#81794)
* Added functional test for alerts list filters by status, alert type and action type. Did a code refactoring and splitting for alerts tests.

* -

* fixed failing tests

* fixed type checks

* minor naming fixes
2020-10-27 10:17:52 -07:00
Matthew Kime
41206e10e4
Index Patterns API - Remove legacy es client usage for field caps (#80116) (#81784)
* remove legacy es client usage
2020-10-27 11:41:40 -05:00
Søren Louv-Jansen
1424fdfffd
[APM] Unskip test (#81574) (#81773) 2020-10-27 17:11:39 +01:00
Larry Gregory
7745a54cb6
[7.x] Doc changes for stack management and grouped feature privileges (#80486) (#81795)
Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
# Conflicts:
#	docs/images/intro-spaces.jpg
2020-10-27 11:54:41 -04:00
Lukas Olson
b947f35200
[data.search] Skip async search tests in build candidates and production builds (#81547) (#81705)
* Skip async search tests in build candidates and production builds

* Add log when skipping
2020-10-27 08:51:57 -07:00
Thomas Neirynck
aee72ffa81
[Maps] Use default format when proxying EMS-files (#79760) (#81767) 2020-10-27 11:25:46 -04:00
Tim Roes
080b62aada
Use the displayName property in default editor (#73311) (#81763)
* Use displayName in field list in visualize editor

* Set key in combo box

* Fix jest tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 15:53:23 +01:00
Maja Grubic
61ac72e5ee
[Discover] Deangularize context.html (#81442) (#81765)
* [Discover] Deangularize context.html

* Removing snapshot testing

* Applying PR comments

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 14:40:30 +00:00
Walter Rafelsberger
25e102a850
[ML] Transforms: Remove index field limitation for custom query. (#81467) (#81755)
The query bar originally developed for the transforms wizard didn't work with indices with more than 1024 fields. In that case we disabled the query bar and showed an info-callout. Since we moved on to make use of the KQL query bar, this limitation does no longer exist so this PR removes the limitation.
2020-10-27 14:57:06 +01:00
Xavier Mouligneau
786ddfb893
[SECURITY SOLUTIONS] Bugs overview page + investigate eql in timeline (#81550) (#81708)
* fix overview query to be connected to sourcerer

* investigate eql in timeline

* keep timeline indices

* trusting what is coming from timeline saved object for index pattern at initialization

* fix type + initialize old timeline to sourcerer

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 09:31:45 -04:00
Joe Reuter
7f27785fbf
[Lens] Fix URL query loss on redirect (#81475) (#81744) 2020-10-27 14:30:27 +01:00
ymao1
89ec824b3c
[Task Manager] Mark task as failed if maxAttempts has been met. (#80681) (#81750)
* wip

* Adding updateFieldsAndMarkAsFailed function

* Updating UBQ

* Only updating retryAt if marking as claiming

* Updating query

* Updating query to only fail one time tasks that have exceeded max attempts

* Fixing tests

* Fixing tests

* Handling claiming tasks by id

* Removing unused function

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 09:27:03 -04:00
Mike Côté
c87aa132d4
Fix previousStartedAt by not changing when execution fails (#81388) (#81670)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 07:51:45 -04:00
Jean-Louis Leysens
79aa050cd4
[ILM] Migrate Warm phase to Form Lib (#81323) (#81735)
* migrate all fields on warm phase except, data alloc, replicas and shrink

* introduce edit policy context to share original policy and migrate shrink and replicas fields

* Refactored biggest field; data allocation

Copied the entire field for now duplicating all of the components

* remove unused import

* complete migration of new serialization

* Remove last vestiges of legacy warm phase

- also removed policy serialization tests for warm phase

* fix existing test coverage and remove use of "none" for node attribute

* added policy serialization tests

* remove unused translations

* Fix use of useFormData after update

- also minor refactor to use useCallback in policy flyout now
  that getFormData changes when the form data changes.

* fix import path

* simplify serialization snapshot tests

* type phases: string -> phases: Phases

* Addressed some PR review items

- refactor toggle click to take a boolean arg
- refactor selection options in data tier component to use a func
  to get select options.

* updated data tier callout logic after new changes

* getPolicy -> updatePolicy

Also rather deconstruct the validate fn from the form object

* fix detection of migrate false and refactor serialization to pure function

* fix type issue

* fix for correctly detecting policy data tier type

- with jest tests see origin here:
https://github.com/elastic/kibana/pull/81642

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 11:47:39 +01:00
Sébastien Loix
d0528b1347
[7.x] [Mappings editor] Add scaled_float and date_range comp integration tests (#81287) (#81317)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-27 08:52:31 +01:00
Frank Hassanabad
a9746e1db2
[Security Solutions][Detection Engine] Fixes critical bug with error reporting that was doing a throw (#81549) (#81728)
## Summary

Fixes an error where it was expecting some data structures on an ES error but there wasn't in some cases.

Before:
<img width="2246" alt="Screen Shot 2020-10-22 at 1 04 35 PM" src="https://user-images.githubusercontent.com/1151048/96940994-7d98a780-148e-11eb-93bd-77e4adf42896.png">

After:
<img width="2229" alt="Screen Shot 2020-10-22 at 5 45 31 PM" src="https://user-images.githubusercontent.com/1151048/96941005-84bfb580-148e-11eb-989f-1dae6892e641.png">

- [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
2020-10-27 00:58:52 -06:00
Catherine Liu
3fa4f3b703
[Home] Fixes Kibana app description order on home page and updates Canvas copy (#80057) (#81691)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 23:40:21 -07:00
Tyler Smalley
dd49b7ebf7
[CI] Preparation for APM tracking on CI (#80399) (#81694)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-10-26 22:51:06 -07:00
Justin Ibarra
226d7e9462
[Detection Rules] Add 7.10 rules (#81676) (#81714) 2020-10-26 20:06:21 -08:00
Spencer
dbc4904a03
[kbn/optimizer] ignore missing metrics when updating limits with --focus (#81696) (#81711)
Co-authored-by: spalger <spalger@users.noreply.github.com>

Co-authored-by: spalger <spalger@users.noreply.github.com>
2020-10-26 20:30:16 -07:00
Yuliia Naumenko
6b2a9b3416
Fixed migration issue for case specific actions, by extending email action migrator checks (#81673) (#81699)
* Fixed migration issue for case specific actions, by extending email action migrator checks

* Fixed e2e test

* fixed due to comments
2020-10-26 19:03:07 -07:00
Nathan Reese
6f1d902e6e
[Maps] fix unable to edit cluster vector styles styled by count when switching to super fine grid resolution (#81525) (#81701)
* [Maps] fix unable to edit cluster vector styles styled by count when switching to super fine grid resolution

* fix typo

* tslint fixes

* review feedback

* more renames

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 19:59:07 -06:00
Kevin Logan
aca70df01c
[SECURITY_SOLUTION] Fix text on onboarding screen (#81672) (#81683) 2020-10-26 20:26:12 -04:00
Constance
bab6af3c17
[App Search] Credentials: implement working flyout form (#81541) (#81657)
* Add key name field

* Add key type field

* Add key read/write fields

* Add key engine access / selection

* Add key update warning callout

* Update flyout body with form components

* [PR feedback] i18n - change appSearch.tokens to appSearch.credentials

* [PR feedback] Remove unnecessary conditional

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 16:26:59 -07:00
Constance
9385b4970c
[App Search] Credentials: Add final Logic and server routes (#81519) (#81540)
* Add fullEngineAccessChecked logic

* Add onEngineSelect logic

* [Refactor] DRY out/simplify http mocks

Note: import reorder is required in for mocks to work correctly

* Add onApiTokenChange logic

* Update flyout footer to use onApiTokenChange

* Add new POST/PUT server routes

+ some opinionated comments

* [PR feedback] tests copy, extra data tests

* [PR feedback] Reuse fullEngineAccessChecked, fix fullEngineAccessChecked being undefined vs a bool

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 14:52:07 -07:00
Chris Roberson
e1b6c68955
[Monitoring] Fix a couple of issues with the cpu usage alert (#80737) (#81669)
* Fix a couple of issues with the cpu usage alert

* Fix tests

* PR feedback
# Conflicts:
#	x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js
2020-10-26 17:32:01 -04:00
Rudolf Meijering
fbc400e1cc
Elasticsearch: don't use url authentication for new client (#81564) (#81659)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 22:27:43 +01:00
ymao1
664445b3c3
[Alerting UI] Don't wait for health check before showing Create Alert flyout (#80996) (#81665)
* wip

* Adding health context provider and option to block waiting for health check

* Adding tests

* Removing forced lag

* Fixing action form not rendering pre selected action

* PR fixes

* Updating i18n ids

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

* Applying i18n fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
2020-10-26 16:50:48 -04:00
Christiane (Tina) Heiligers
d7abf47fa4
[7.x] Telemetry collection xpack to ts project references (#81269) (#81663)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 13:41:43 -07:00
Ahmad Bamieh
6bc83d613d
[7.x] [Usage collection] Make schema mandatory (#79999) (#81595)
* [Usage collection] Make `schema` mandatory (#79999)

Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_settings_collector.ts

* eslint fix

Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2020-10-26 22:34:13 +02:00
Devon Thomson
cd06550a2e
[Time To Visualize] Edit Panel Title On Click (#81076) (#81534)
* Made embeddable panel title click launch the customize panel action

Co-authored-by: Ryan Keairns <contactryank@gmail.com>
2020-10-26 16:17:12 -04:00
Marshall Main
3aaa3ea71b
[Security Solution][Detections] Check mapping version on signals index (#81277) (#81655)
* Check mapping version instead of template version and throw useful error messages on failures

* Fix comment

* Move MIN_EQL_RULE_INDEX_VERSION next to mapping version
2020-10-26 16:05:38 -04:00
Larry Gregory
fcf0de51ed
[7.x] Properly encode links to edit user page (#81562) (#81651) 2020-10-26 16:04:33 -04:00
Chris Cowan
cb65d36b85
[Metrics UI] Fix Metrics Explorer API to return empty results when field is missing from aggregation (#80919) (#81638)
* [Metrics UI] Fix Metrics Explorer API to return empty results when field is missing from aggregation

* Update x-pack/plugins/infra/server/routes/metrics_explorer/lib/convert_request_to_metrics_api_options.ts

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>

* Fixing type

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 12:19:06 -07:00
Chris Cowan
9f573b5689
[Metrics UI] Add timerange and sorting to node detail metadata request (#81033) (#81336)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 12:17:44 -07:00
Chris Roberson
584bb3a20b
Unskip test (#81568) (#81646)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 14:53:35 -04:00
Xavier Mouligneau
1bc7eb8139
[SECURITY SOLUTION] exclude cloud alias index from our query (#81551) (#81634)
* exclude cloud alias index

* only exclude cloud alias when logs-* is there
2020-10-26 13:50:39 -04:00
Nathan Reese
45cdc5d14a
[Maps] fix auto-refresh not auto fitting to bounds (#81251) (#81625)
* [Maps] trigger auto fit to bounds on refresh trigger

* default auto fit to data bounds to false

* update jest snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-26 10:44:01 -06:00