Commit graph

390 commits

Author SHA1 Message Date
Yuliia Naumenko
37525f80a0
License checks for alerts plugin (#85649)
* [Alerts][License] Define minimum license required for each alert type (#84997)

* Define minimum license required for each alert type

* fixed typechecks

* fixed tests

* fixed tests

* fixed due to comments

* fixed due to comments

* removed file

* removed casting to LicenseType

* [Alerts][License] Add license checks to alerts HTTP APIs and execution (#85223)

* [Alerts][License] Add license checks to alerts HTTP APIs and execution

* fixed typechecks

* resolved conflicts

* resolved conflicts

* added router tests

* fixed typechecks

* added license check support for alert task running

* fixed typechecks

* added integration tests

* fixed due to comments

* fixed due to comments

* fixed tests

* fixed typechecks

* [Alerting UI][License] Disable alert types in UI when the license doesn't support it. (#85496)

* [Alerting UI][License] Disable alert types in UI when the license doesn't support it.

* fixed typechecks

* added licensing for alert list and details page

* fixed multy select menu

* fixed due to comments

* fixed due to comments

* fixed due to comments

* fixed typechecks

* fixed license error message

* fixed license error message

* fixed typechecks

* fixed license error message

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-14 19:29:39 -08:00
Chandler Prall
84d7b9e4ac
Upgrade EUI to v30.6.0 and update jest snapshots (#85504) 2020-12-14 15:18:29 -07:00
Chris Roberson
6ae00fb514
[Monitoring] Convert Beats-related server files that read from _source to typescript (#85193)
* Beats to TS

* PR feedback

* Fix types

* Fix types

* Fix failing test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-14 12:12:11 -05:00
Chris Roberson
1e8f2f66eb
[Monitoring] Some progress on making alerts better in the UI (#81569)
* Some progress on making alerts better in the UI

* Handle edge case

* Updates

* More updates

* Show kibana instances alerts better

* Stop showing missing nodes and improve the detail alert UI

* WIP

* Fix the badge display

* Okay I think this is finally working

* Fix type issues

* Fix tests

* Fix tests

* Fix alert counts

* Fix setup mode listing

* Better detail page view of alerts

* Feedback

* Sorting

* Fix a couple small issues

* Start of unit tests

* I don't think we need this Mock type

* Fix types

* More tests

* Improve tests and fix sorting

* Make this test more resilient

* Updates after merging master

* Fix tests

* Fix types, and improve tests

* PR comments

* Remove nextStep logic

* PR feedback

* PR feedback

* Removing unnecessary changes

* Fixing bad merge issues

* Remove unused imports

* Add tooltip to alerts grouped by node

* Fix up stateFilter usage

* Code clean up

* PR feedback

* Fix state filtering in the category list

* Fix types

* Fix test

* Fix types

* Update snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-13 10:20:29 -05:00
ymao1
ab082647ac
[Actions] Notify only on action group change (#82969)
* plugged Task Manager lifecycle into status reactively

* fixed tests

* Revert "fixed tests"

This reverts commit e9f2cd05bd.

* made action group fields optional

* revert deletion

* again

* extracted action type for mto its own component

* extracted more sections of the action form to their own components

* updated icon

* added docs

* fixed always firing alert

* fixed export of components

* fixed react warning

* Adding flag for notifying on state change

* Updating logic in task runner

* Starting to update tests

* Adding tests

* Fixing types check

* Tests and types

* Tests

* Tests

* Tests

* Tests

* Tests

* Renaming field to a more descriptive name. Adding migrations

* Renaming field to a more descriptive name. Adding migrations

* Fixing tests

* Type check and tests

* Moving schedule and notify interval to bottom of flyout. Implementing dropdown from mockup in new component

* Changing boolean flag to enum type and updating in triggers_actions_ui

* Changing boolean flag to enum type and updating in alerts plugin

* Fixing types check

* Fixing monitoring jest tests

* Changing last references to old variable names

* Moving form inputs back to the top

* Renaming to alert_notify_when

* Updating functional tests

* Adding new functional test for notifyWhen onActionGroupChange

* Updating wording

* Incorporating action subgroups into logic

* PR fixes

* Updating functional test

* Fixing types check

* Changing default throttle interval to hour

* Fixing types check

Co-authored-by: Gidi Meir Morris <github@gidi.io>
2020-12-10 15:51:52 -05:00
igoristic
d743107420
Fixed filter based on current node (#85615) 2020-12-10 14:56:23 -05:00
igoristic
a41881d463
[Monitoring] Optimizing alerting code (#83681)
* Optimize alerting code

* Merged all the branches

* resolved conflict

* optimizing all branches merged

* Fixed tests and resolved conflicts

* Fixed jest tests

* Resolved merge conflicts with the alerting team's PR
2020-12-08 10:16:06 -05:00
Yuliia Naumenko
6757b95b1e
[Alerting UI] Replaced AlertsContextProvider with KibanaContextProvider and exposed components in API (#84604)
* [Alerting UI] Replaced AlertsContextProvider with KibanaContextProvider and exposed components in API

* removed AlertContextProvider

* exposed AlertAdd and EditAlert flyouts with triggers_actions_ui plugin start

* fixed type check

* fixed tests

* fixed typechecks

* fixed wrong consumer

* fixed monitoring flyout flickering

* fixed due to comments

* fixed typechecks

* fixed typechecks

* fixed typechecks

* fixed typechecks

* fixed due to comments
2020-12-07 16:44:40 -08:00
igoristic
d19b558c88
[Monitoring][Alerting] Added core features to Kibana services UPDATED (#85074)
* added core features to kibana services

* Added test for alert form

* Added mocking of legacy shims and actions

* Fixed typing

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-07 12:25:28 -05:00
igoristic
008c6a0e19
Safegaurding alerts in case they come back undefined (#85108) 2020-12-07 11:24:44 -05:00
Brian Seeders
554ee9ebf9
Revert "[Monitoring][Alerting] Added core features to Kibana services (#84486)"
This reverts commit 4545f56a46.
2020-12-04 14:24:49 -05:00
Chris Roberson
58f90280cb
[Monitoring] Convert APM-related server files that read from _source to typescript (#84829)
* get_apms converted

* More APM ones

* get_beat_summary

* Fix test

* This is optional

* Fix tests

* Be more safe
2020-12-04 13:36:09 -05:00
igoristic
4545f56a46
[Monitoring][Alerting] Added core features to Kibana services (#84486)
* added core features to kibana services

* Added test for alert form

* Added mocking of legacy shims and actions
2020-12-04 13:33:47 -05: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
Chris Roberson
2ad3d2bc53
Make alert status fetching more resilient (#84676) 2020-12-02 07:23:50 -05:00
Alejandro Fernández Haro
717a66fc6c
TelemetryCollectionManager: Use X-Pack strategy as an OSS overwrite (#84477) 2020-12-02 08:26:45 +00:00
Alejandro Fernández Haro
cb55898c98
[UsageCollection] Remove formatBulkUpload and other unused APIs (#84313)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-30 11:30:47 +00:00
Chris Roberson
dfa9c75021
Fix issues with show_license_expiration (#84361) 2020-11-25 15:15:46 -05:00
Chris Roberson
ced1dadb8a
[Monitoring] Only look at ES for the missing data alert for now (#83839)
* Only look at ES for the missing data alert for now

* PR feedback

* Fix tests
2020-11-25 08:50:03 -05:00
Chris Roberson
0f780229b5
Put the cluster_uuid in quotes (#83987)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-25 08:49:17 -05: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
Alejandro Fernández Haro
ff19bf548a
[Monitoring] Stop collecting Kibana Usage in bulkUploader (#83546) 2020-11-20 08:55:22 +00:00
Chris Roberson
a24606d035
Fix small issue with detecting missing monitoring data from APM (#83646)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-19 12:16:19 -05:00
Alejandro Fernández Haro
37636f3e35
[Telemetry] Move Monitoring collection strategy to a collector (#82638)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-18 18:16:38 +00:00
Alejandro Fernández Haro
484437f66d
[UsageCollection] Expose KibanaRequest to explicitly opted-in collectors (#83413) 2020-11-18 08:32:33 +00:00
Greg Thompson
8a7af5bbda
Upgrade EUI to v30.2.0 (#82730)
* eui to v30.2.0

* src snapshot updates

* x-pack euipanel snapshot updates

* x-pack external link updates

* security_solution_cypress external link text

* clean up
2020-11-17 14:29:57 -07:00
John Schulz
380fa5b3f6
[bundle optimization] Update to semver 7.x to get tree-shaking (#83020)
## What's changed in this PR
### Update to latest available `semver`: `7.3.2`
 * `semver` 5.x pulls in the entire library in one large file (~38k uncompressed / ~9k gz), when we might only use 1-2K.
 * `semver` 7.0+ supports tree-shaking: https://github.com/npm/node-semver/blob/master/CHANGELOG.md#700

### Update paths to only import individual function(s) used instead of the entire library
  * Getting the smaller bundle requires a different import style [as shown in the docs](https://github.com/npm/node-semver#usage)
  * Only changed code in `public` & `common` folders; not `server`. We could also update `server` as well for consistency, but I skipped because the new import style is more verbose and the filesize didn't seem as important on the server

### Results
The build stats show a 10K+ improvement for initial page bundles https://github.com/elastic/kibana/pull/83020#issuecomment-724724432

| id | [before](c6afc47f32) | [after](213bb52a8c) | diff |
| --- | --- | --- | --- |
| `ingestManager` | 386.2KB | 373.9KB | -12.3KB |
| `telemetry` | 63.5KB | 50.1KB | -13.5KB |
| `upgradeAssistant` | 74.5KB | 60.5KB | -14.0KB |
| total |  |  | -39.7KB |

### The import paths look odd. Are they required?
I agree and, no, they're not strictly required. If you'd like me to revert to the prior style just drop a comment and I'll undo them.

The caveat is that the current style (in `master` & this PR) pulls in the entire `semver` library. In 7.x that added ~15K to the initial size. Some more details in the comments: https://github.com/elastic/kibana/pull/83020#issuecomment-724859130

### Possible issues
Moving 2 major versions. We're currently on 5.7 and the latest available is 7.3. 
  * changelog says 5.x (our current) to 6.0 should be safe: https://github.com/npm/node-semver/blob/master/CHANGELOG.md#60
  * There 6.x & 7.x changes all appear to be new features or bugfixes around the `includePrerelease` flag added in 5.6, but I'm not sure if those "fixes" will break existing code
    * https://github.com/npm/node-semver/blob/master/CHANGELOG.md#613
    * https://github.com/npm/node-semver/blob/master/CHANGELOG.md#722

### Stats / screenshots
generated with `node scripts/build_kibana_platform_plugins.js --profile --focus=ingestManager`
<details><summary><b>Ingest Manager in `master`</b>: imports entire `semver` lib, totals 40k+, only 1 large file (orange arc below)</summary>

<img width="972" alt="Screen Shot 2020-11-09 at 6 50 23 PM" src="https://user-images.githubusercontent.com/57655/98666188-a50ac380-231a-11eb-9b8a-6ca784752714.png">
</details>

<details><summary><b>Ingest Manager in PR after upgrade to 7</b>: still imports entire lib. file size *increased* to ~60k, but now individual files are imported (orange arcs below)</summary>
<img width="825" alt="Screen Shot 2020-11-09 at 5 46 30 PM" src="https://user-images.githubusercontent.com/57655/98666355-e602d800-231a-11eb-803f-bc04beb4eaf1.png">
<img width="963" alt="Screen Shot 2020-11-09 at 5 47 06 PM" src="https://user-images.githubusercontent.com/57655/98666357-e69b6e80-231a-11eb-92d3-c66904f92c30.png">
</details>

<details><summary><b>Ingest Manager in PR after changing `import`s:</b> total imported size down to ~20k. Can see individual imported files</summary>
<img width="926" alt="Screen Shot 2020-11-10 at 6 10 23 AM" src="https://user-images.githubusercontent.com/57655/98667058-e64fa300-231b-11eb-9690-5e36ed6475e0.png">
<img width="895" alt="Screen Shot 2020-11-10 at 6 10 53 AM" src="https://user-images.githubusercontent.com/57655/98667059-e780d000-231b-11eb-8abf-98d8bdbcf061.png">
</details>

### 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
2020-11-14 07:32:02 -05:00
Tyler Smalley
aba2068291
Consolidates Jest configuration files and scripts (#82671)
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to  previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project.

OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest`

Blocker to #72569

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-11-12 16:19:56 -08:00
Thomas Watson
4c49d5d1be
Upgrade Node.js to version 12 (#61587) 2020-11-12 22:00:57 +01:00
Mike Côté
1ecd12cdf3
Add description and documentation link in alert flyout (#81526)
* Add description and documentation URL in alert flyout

* Add unit tests

* Fix type check

* Add horizontal rule

* Design fixes

* Fix uptime alert link

* Fix uptime urls

* Add anchor tag

* Fix jest test failures

* Fix monitoring links
2020-11-05 19:50:50 -05:00
Mike Côté
eb43158bdd
Add descriptions to alert types (#81850)
* Initial attempt at adding descriptions to alert types

* Fix typecheck failures

* Fix i18n check

* Fix failing jest test

* Fix i18n check again

* Apply changes for Uptime

* Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

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

* Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

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

* Fix jest test

* Update geo threshold description

* Update description of some alert types based on feedback from Gail

* Update description of some alert types based on feedback from Gail

* Fix i18n

* Fix i18n

* Fix ESLint

* Update some copy

* Update uptime alert description

* Fix typos

Co-authored-by: Casper Hübertz <casper@formgeist.com>
2020-11-03 14:09:41 -05:00
Chris Roberson
53a4fcd87c
Add catch clause to handle exceptions (#82179) 2020-11-02 14:21:34 -05:00
Chris Roberson
44577f3bd5
Fix the plugins passed into legacy routes to ensure they are setup and not start plugins (#82192) 2020-11-02 14:15:20 -05:00
Thomas Watson
700225061a
Upgrade to hapi version 18 (#80468) 2020-11-02 13:18:00 +01:00
Ahmad Bamieh
1af551bae1
[Telemetry] Remove from and to timestamps from usage stats APIs (#81579)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-02 13:51:18 +02:00
Greg Thompson
6fdc7eb1fa
Upgrade EUI to v30.1.1 (#81499)
* eui to v30.0.0

* removed unused RecentLinks component

* update compressed -> display prop

* euiformrow compressed -> display

* euipopover remove withtitle

* euibuttongroup prop updates

* remove euibuttontoggle

* src snapshot updates

* tutorial euibuttongroup update

* x-pack snapshot updates

* euibuttongroup test updates

* TODO

* misc. js file updates

* remove euinavdrawer scss references

* translation removals

* more x-pack snapshot updates

* update data-test-subj lookup

* icons logoAMP -> logoObservability

* cypress selector updates

* update euibuttontoggle onchange, test interaction

* Fix auto-update toggle in Visualize

* some more change -> click test updates

* idtoselectedmap change

* Fix feature table button group

* Remove empty SASS file

* Fix feature table button group II

* Using `compressed` to also dictate dual range row

* Fix a few security labels

* An ML fix

* Apply suggestions from code review

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>

* remove unused translation

* update view_type_toggle snapshot

* more snapshot updates

* eui to 30.1.0

* undo temp ts-ignore

* more x-pack snapshot updates

* eui to 30.1.1

* update feature privilege text

* Update x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/sub_feature_form.tsx

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>

* reuse i18n token

* Adapt log entry action button to new `minWidth` prop

* clean up label

* Combine auto apply strings into one

* ternary fix

* cases status useCallback

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Felix Stürmer <stuermer@weltenwort.de>
2020-10-30 16:18:27 -06:00
igoristic
c1294f0177
[Monitoring] Thread pool rejections alert (#79433)
* Thread pool rejections first draft

* Split search and write rejections to seperate alerts

* Code review feedback

* Optimized page loading and bundle size

* Increased monitoring bundle limit

* Removed server app import into the frontend

* Fixed tests and bundle size

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-30 10:50:34 -04:00
Chris Roberson
d784840ac1
[Monitoring] Fix a couple of issues with the cpu usage alert (#80737)
* Fix a couple of issues with the cpu usage alert

* Fix tests

* PR feedback
2020-10-26 15:47:56 -04:00
Alejandro Fernández Haro
38c6d1f0b8
[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>
2020-10-26 12:57:15 +02:00
Chris Roberson
d916f18d23
Ensure some data is returned (#81375) 2020-10-21 17:57:41 -04:00
Chris Roberson
f2df965c89
Fix alert defaults (#81207)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-21 14:51:16 -04:00
Chris Roberson
7017ca6f5b
[Monitoring] Use async/await (#81200)
* Use async/await

* Make sure we tell angular what's up
2020-10-21 14:01:02 -04:00
Larry Gregory
bf0f8bbb42
Cleanup feature registration (#80909) 2020-10-20 12:53:43 -04:00
PavithraCP
0ab073828d
Fix bug in logs UI link (#80943) 2020-10-19 22:21:04 -04:00
Chris Roberson
b019b57422
[Monitoring] Fix bug with setup mode appearing on pages it shouldn't (#80343)
* Ensure we check for local setup mode data first

* Use a context to ensure deeply nested components have access

* Fix snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 22:05:25 -04:00
Chandler Prall
42a1744af6
Upgrade EUI to v29.5.0 (#80753)
* Upgraded eui to v29.5.0; snapshot updates

* Cleaned up some types

* addresses feedback on types change

* Update EuiIcon snapshots in jest integration tests

* Updated snapshot from rebasing on master
2020-10-19 14:48:33 -06:00
Chris Roberson
3f97872055
[Monitoring] Fix cluster listing page in how it handles global state (#78979)
* Properly unset global state on the listing page

* Fix how we handle global state in getSafeForExternalLink

* Fix breadcrumbs for clusters link

* Fix tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 15:10:11 -04:00
Chris Roberson
dbb4942c3c
Update label (#80660)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-19 13:51:09 -04:00
Chris Roberson
62c93aa009
Fix sorting of alerts (#80546)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-15 12:16:51 -04:00
Christiane (Tina) Heiligers
9afd63f56d
[Usage Collection] Usage collection add saved objects client to collector fetch context (#80554) 2020-10-14 16:26:49 -07:00