Commit graph

745 commits

Author SHA1 Message Date
Alejandro Fernández Gómez
77e25bedfb
[Logs UI] Fix alert previews for thresholds of 0 (#111150)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-08 11:33:00 +02:00
Milton Hultgren
51fd4abe20
[Logs UI] Improve log threshold rule field selection (#111135)
* [Logs UI] Use ComboBox for criterion field selection (#110996 
* [Logs UI] Make log threshold criterion field clearable
2021-09-07 14:21:18 +02:00
Zacqary Adam Xeper
a99360fa32
[Metrics UI] Filter out APM nodes from the inventory view (#110300)
* [Metrics UI] Filter out APM nodes from the inventory view

* Update jest snapshots

* Add tests for fs for filtering out APM nodes
2021-09-03 09:28:11 +09:00
Chris Cowan
0452483e7d
[Metrics UI] Add integration tests for Metric Threshold Rule and refactor to fire correctly (#109971)
* [Metrics UI] Add integration tests for Metric Threshold and refactor to fire correctly

* Removing unused variables

* Fixing tests for metric_threshold_executor

* Fixing test for metric_query

* fixing test

* Changing type guard
2021-09-02 10:38:45 -06:00
Georgii Gorbachev
a299604c58
[RAC][Rule Registry] Implement versioning and backing indices (#109276)
**Ticket:** https://github.com/elastic/kibana/issues/109293

🚨 **This PR is critical for Observability 7.15** 🚨

## Summary

This PR fixes the indexing implementation in `rule_registry`. It implements the suggestions for backwards compatibility described in the ticket:

- changes the naming scheme and introduces the concept of "backing indices", so that names of the concrete ("backing") indices != names of their aliases
- adds versioning based on the current Kibana version

TODO:

- [x] Change index naming (implement the concept of backing indices)
- [x] Include Kibana version into the index template metadata
- [x] Include Kibana version into the document fields
- [x] Remove `version` from `IndexOptions` (parameters provided by solutions/plugins when initializing alerts-as-data indices)
- [x] Fix CI

### Checklist

- [ ] [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
2021-08-25 19:54:25 +02:00
mgiota
098a797636
[Logs UI] stop accordion chart preview from auto expanding/collapsing (#109581)
* stop propagation to the criterion popovers

* fix toggling issue with criteria popovers

* Fixes for more popovers staying open

* another toggling fix "for the last" popover
2021-08-23 20:08:24 +02:00
renovate[bot]
41162c3940
Update dependency @elastic/elasticsearch to ^8.0.0-canary.17 (#107536)
* Update dependency @elastic/elasticsearch to ^8.0.0-canary.15

* update tests for new error message building mechanism

* fix integration tests

* fix functional test

* mute new type errors

* fix new type errors

* bump es client to canaary.16

* fix integration test

* fix type errors in infra plugin

* mute type error in ml plugin

* fix type errors in monitoring plugin

* fix and mute errors in security solution plugin

* bump version to canary.18

* remove an unnecessary change

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: restrry <restrry@gmail.com>
2021-08-17 08:44:24 -04:00
Ester Martí Vilaseca
ae947ceda9
[Metrics UI] Fix refresh button for node details page (#108666)
* Fix refresh button for node details page

* Fix types
2021-08-17 11:09:38 +02:00
Kate Farrar
e6d446acd7
updating waffle icon and toggle style (#108758) 2021-08-16 18:36:11 -06:00
Katrin Freihofner
a80243aab2
Adjusts panel styling in metrics and logs settings (#108412)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-16 09:10:59 -04:00
Katrin Freihofner
7f5c1b43ad
Change orientation of the ML setup form (#108339)
Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-16 08:01:26 -04:00
Georgii Gorbachev
2ee11db1fa
[RAC][Rule Registry] Improve RuleDataService API and index bootstrapping implementation (#108115)
**Addresses:** https://github.com/elastic/kibana/issues/106421, https://github.com/elastic/kibana/issues/106428, https://github.com/elastic/kibana/issues/102089, https://github.com/elastic/kibana/issues/106433

## Summary

This PR focuses on consolidation of indexing implementations in `rule_registry` (https://github.com/elastic/kibana/issues/101016). It addresses some of the sub-tasks of the parent ticket.

- [x] Encapsulate index bootstrapping logic in a new improved API exposed by `RuleDataService`.
- [x] Enforce allowed values for the `datasetSuffix` on the API level.
- [x] Migrate plugins using the existing `RuleDataService` API to the improved one.
- [x] Make sure index names comply with design architecture.
    - https://github.com/elastic/kibana/issues/102089
- [x] Improve the API of `RuleDataClient`.
- [x] Enhance index bootstrapping: support custom ILM policy per index (`{registrationContext}.{datasetSuffix}`).
- [x] Enhance index bootstrapping: create index template per namespace and support rollovers properly
    - based on https://github.com/elastic/kibana/pull/107700
- [x] Enhance index bootstrapping: support secondary aliases
    - based on https://github.com/elastic/kibana/pull/107700
- [x] Remove `EventLogService` implementation
    - https://github.com/elastic/kibana/issues/106433

This will be addressed in follow-up PRs:

- [ ] Enhance index bootstrapping: implement suggestions for backwards compatibility (naming scheme for alias and backing indices; versioning).
- [ ] Enhance index bootstrapping: implement upgrades of existing index templates.
- [ ] Make index bootstrapping logic more robust. This _is partially addressed_ in this PR, but more improvements are needed.
- [ ] Change the way index prefix works.
- [ ] Add support for optional TS schema (static typing).
- [ ] Update `README` in `rule_registry`.

### Checklist

- [ ] [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
2021-08-15 14:52:44 +02:00
Patryk Kopyciński
9d0a7b8394
[Osquery] Add Osquery tab to node details tabs (#104272) 2021-08-14 07:25:24 -04:00
Liza Katz
e91baea5dc
[Data][Es Query] Use ES types instead of DslQuery (#108290)
* es-query types

* jest and lint

* cc

* options

* type

* type
2021-08-12 21:23:33 +02:00
Chris Cowan
acba612586
[Metrics UI] Move saved views button to page header (#107951)
* [Metrics UI] Move saved views button to page header

* fixing types

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-12 10:25:56 -06:00
Chris Cowan
9045f736e4
[Metrics UI] Remove alert previews (#107978)
* [Metrics UI] Remove alert previews

* Fixing i18n strings

* Adding back in isTooManyBucketsPreviewException for evaluate_alert

* Fixing import

* Removing more obsolete code

* removing unused strings for i18n

* removing unused range function
2021-08-12 10:24:59 -06:00
Kerry Gallagher
900052f32c
[APM] Add a logs tab for services (#107664)
* Add a logs tab for APM services

Co-authored-by: Søren Louv-Jansen <sorenlouv@gmail.com>
2021-08-11 19:51:32 +01:00
Spencer
c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
Liza Katz
204efae5bf
[Data cleanup] unify serializable state (#107745)
* Use Serializable from package

* Rename to align with core

* fix

* more replacements

* docssss

* fix

* Move it to @kbn/utility-types and remove core export

* buildy build

* tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-10 13:03:48 +02:00
Zacqary Adam Xeper
eed9723c85
[Metrics UI] Add checkbox to optionally drop partial buckets (#107676) 2021-08-05 14:23:33 -07:00
Zacqary Adam Xeper
e9913264c7
[Metrics UI] Fix metric threshold preview regression (#107674) 2021-08-05 13:39:22 -07:00
Mikhail Shustov
1cfc2ebf90
[Maps] [Infra] do not import types from the legacy elasticsearch package (#107118)
* remove elasticsearch import from infra

* remove elasticsearch import from maps
2021-07-29 19:14:37 +02:00
mgiota
7f6ff62402
[Metrics UI]: register metric threshold rule type with RAC (#106684)
* [Metrics UI]: register metric threshold rule type with RAC

* index reason in metric threshold executor

* fix failing metric executor unit tests

* refactor createLifecycleRuleExecutor

* create LifecycleRuleExecutor mock

* fix types

* fix option types

* avoid empty reason field

* more type fixes
2021-07-29 17:58:18 +02:00
Phillip Burch
2093447203
[Metrics UI] Correct inaccurate offsetting for non-rate aggregations inside of metrics threshold alerts (#106947)
* Don't skip last bucket for most aggs

* Allow alerting on partial buckets for certain aggs

* Fix test, PR feedback, and some comments

* Remove all offset logic for date_range aggs

* Remove code comment

* Add delivery delay

* Fix the date range for query

* Add TODO
2021-07-28 17:29:46 -05:00
Alejandro Fernández Gómez
040cf56d8e
[RAC][Metrics UI] Index reason field on inventory metric alerts (#106842)
Co-authored-by: mgiota <giota85@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-28 13:32:09 -04:00
Yuliia Naumenko
f589c2fc29
[Alerting] Rename alertTypeRegistry to ruleTypeRegistry according to the new terminology. (#106519)
* [Alerting] Renamed Alerting framework AlertsClient to RulesClient according to the new terminology.

* fixed path

* fixed type checks

* fixed type checks

* [Alerting] Rename alertTypeRegistry to ruleTypeRegistry.

* Apply suggestions from code review

Co-authored-by: ymao1 <ying.mao@elastic.co>

* fixed type checks

* fixed tests

* fixed merge issues

* fixed merge issues

* fixed tests

* fixed tests

* fixed functional tests

Co-authored-by: ymao1 <ying.mao@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-27 10:03:00 -07:00
Alexey Antonov
fcaa4aaf40
[TSVB] [Table] js -> ts conversion (#105094)
* table js -> ts

* remove any's

* fix CI

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-27 18:07:43 +03:00
Felix Stürmer
2392b4f24a
[Logs UI] Improve log threshold alert factory argument order (#106532)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-26 15:26:39 +02:00
Chris Cowan
bda98e70f2
[Metrics UI] Ensure alert dropdown closes properly (#106343) 2021-07-22 18:21:14 -07:00
Chris Cowan
75d4250fd4
[Metrics UI] Create functional tests for Metrics Explorer (#105869)
* [Metrics UI] Create saved view tests for Metrics Explorer

* Adding basic functionality tests

* Adding missing metric test

* Adding chart customizations

* Fixing import

* Fixing es archive path

* fixing home page tests for saved objects to match metrics explorer

* Update x-pack/test/functional/apps/infra/home_page.ts

Co-authored-by: Sandra Gonzales <neptunian@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sandra Gonzales <neptunian@users.noreply.github.com>
2021-07-22 15:37:25 -07:00
Chris Cowan
d921df04c9
[Metrics UI] Increase number of saved objects fetched to 1000 (#106310) 2021-07-22 06:44:34 -07:00
Felix Stürmer
1a7469f756
[Logs UI] Index reason in log threshold executor (#106291) 2021-07-22 15:06:36 +02:00
Alejandro Fernández Gómez
a397e0f60a
[Logs UI] Prevent the "Alerts and rules" context menu from sticking (#106408) 2021-07-22 14:46:41 +02:00
mgiota
eaa6dcb579
[RAC] [Metrics UI] Register Inventory rule types with new RAC rules registry (#105706)
* WIP: register inventory metric threshold as lifecycle rule

* fix inventory executor error

* save alerts into ES

* temp

* basic format reason for inventory threshold

* clean up, fix i18n error and temporarily remove types

* delete serialized params

* include group name in the reason

* cleanup

* link to default metrics page

* grab the value and threshold for the inventory item

* fix typo

* fix check types

* remove threshold and currentValue, the reason field will contain this info for combined conditions

* remove thereshold and value from the reason, soon will be replaced by indexed reason field

* remove unnecessary export

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-22 11:46:40 +02:00
Liza Katz
a6af9d5050
[Es query] Move to package (#103530)
May the forces of bootstrapping helps us 🙏🏻 😉
2021-07-21 17:10:55 +02:00
ymao1
e2aacdc186
[Alerting] Allow rule types to extract/inject saved object references on rule CRU (#101896)
* Adding function hooks into rule type definition and call extract fn on rule create

* Adding hooks for extracting and injecting saved object references. Adding extractReferences to create and update workflow

* Adding type template for extracted params

* Adding type template for extracted params

* Adding type template for extracted params

* Adding type template for extracted params

* Calling injectReferences function if defined. Finishing unit tests for create and update

* Adding tests for get

* Adding tests for find

* Cleanup

* Fixing types check

* Fixing functional tests

* Fixing functional tests

* Fixing tests

* Updating README

* Throwing boom error instead of normal error

* Adding framework level prefix to extracted saved object reference names

* Fixing types

* Fixing types

* PR fixes

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-20 17:09:02 -04:00
Constance
bc4928fd0b
[Enterprise Search] Create reusable EntSearchLogStream component (#105804)
* Set up Kibana dependencies required by LogStream component

- notably, `infra` and `data` - @see https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#prerequisites

- tsconfig.json note - I believe I missed kibana_react from when we previously started requiring it for KibanaPageTemplate. Because LogStream requires it for KibanaContextProvider anyway I decided to add as a reference just in case

* Set up log source configuration for ent search logs

@see https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#with-a-source-configuration

or, monitoring plugin also has example usage

* Set up providers required by the LogStream component

@see https://github.com/elastic/kibana/blob/master/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx#prerequisites

Note: there's some overlap in KibanaContextProvider with KibanaLogic that may be worth investigating/DRYing out in the future

* Create reusable EntSearchLogStream component

- light wrapper over LogStream with certain prepopulated defaults

+ Update LogStreamProps from infra team to be exported publicly for reuse (eslint will error otherwise)

* Fix bad type export

- thanks @afgomez!!

* Fix failing security_only nav_links test

- which was caused by `spaces` being required by infra but optional for our plugin. I moved `spaces` to required by `enterprise_search for clarity.

- I'm still not sure I actually fixed the nav_links test correctly. I have almost no memory of adding those lines 12 months ago 🙈

* Fix spaces typing

- remove `?` notation now that it's a required and non-optional plugin
+ reorder required plugins slightly

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-20 13:58:57 -04:00
Kerry Gallagher
32206b9284
Fix top controls responsive layout (#106107) 2021-07-20 12:01:42 +01:00
Chris Cowan
cb7187f71f
[Metrics UI] Drop partial buckets from ALL Metrics UI queries (#104784)
* [Metrics UI] Change dropLastBucket to dropPartialBuckets

- Change offset calculation to millisecond percission
- Change dropLastBucket to dropPartialBuckets
- Impliment partial bucket filter
- Adding partial bucket filter to metric threshold alerts

* Cleaning up getElasticsearchMetricQuery

* Change timestamp to from_as_string to align to how date_histgram works

* Fixing tests to be more realistic

* fixing types; removing extra imports

* Fixing new mock data to work with previews

* Removing value checks since they don't really provide much value

* Removing test for refactored functinality

* Change value to match millisecond resolution

* Fixing values for new partial bucket scheme

* removing unused var

* Fixing lookback since drops more than last buckets

* Changing results count

* fixing more tests

* Removing empty describe

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-19 12:11:50 -07:00
Kate Farrar
2079d61544
[Metrics UI] Inventory layout issues - interval language to tooltip (#105687)
inventory view - moved interval label language to a tooltip to make more room for waffle map controls responsively
2021-07-15 12:29:00 -06:00
mgiota
6e30483cbf
[Logs&Metrics UI] add owner properties to plugin manifest (#105580) 2021-07-14 22:25:17 +02:00
Felix Stürmer
e9f42d27eb
[Logs UI] Register log threshold rule as lifecycle rule (#104341)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-13 11:59:11 +02:00
Caroline Horn
42c743be88
[Top Menu] Increase size of top menu links to s (#103144)
* Increased non-emphasized header links size from `xs` to `s`
* [Observability] Updating header links to use EuiHeaderLink
* [Spaces Menu] Larger spinner
* [Help Menu] Increase size of links
* [Canvas] Increase size to `s`
2021-07-12 12:50:41 -04:00
Vadim Dalecky
15d47ec2c1
ML locator (#103652)
* fix: 🐛 cast type

* chore: 🤖 remove unused parameter

* feat: 🎸 implement ML locator

* test: 💍 add locator tests

* feat: 🎸 expose ML locator form plugin contract

* feat: 🎸 deprecate ml url generator

* feat: 🎸 use locator in useMlHref() React hook

* fix: 🐛 remove non-existing property

* fix: 🐛 remove unused parameter

* feat: 🎸 replace url generator by locator

* refactor: 💡 remove ML url generator and replace by locator

* fix: 🐛 correct type check error

* test: 💍 add share plugin mock and use it

* test: 💍 update mock

* Remove usage of excludeBasePath

* Fix recently accessed url for create job to data visualizer

* refactor: 💡 rename interface

* test: 💍 move locator mock into the share plugin

* test: 💍 update Jest snapshot

* test: 💍 use shared URL service mock

* refactor: 💡 update usage after merging latest

* refactor: 💡 use locator instead of generator

* chore: 🤖 remove unused import

Co-authored-by: Quynh Nguyen <quynh.nguyen@elastic.co>
2021-07-08 16:24:12 +02:00
Alejandro Fernández Gómez
f5c4a05701
[Fleet][Logs UI] Ensure the <LogStream /> component reacts to query changes (#103876)
* Ensure the <LogStream /> component reacts to query changes

* Remove unused import
2021-07-07 11:37:01 +02:00
mgiota
ba85f45014
[Logs & Metrics] refactor breadcrumbs (#103249)
* [Logs & Metrics] refactor breadcrumbs

* [Logs & Metrics] remove Header component, move translations and create readonly badge hook

* add breadcrumb to metric detail page

* fix check_file_casing ci issues

* create separate breadcrumb hook for logs and metrics

* fix metrics translation title

* fix wrong imports and unused variables

* fix translation imports

* fix unused import

* refactor use_breadcrumbs

* remove Header component

* fix linter exhaustive-deps error by wrapping into useMemo

* refactor use_readonly_badge

* remove commented out code

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-01 12:13:33 +02:00
mgiota
de9b62ac4f
[Metrics UI]: add system.cpu.total.norm.pct to default metrics (#102428)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-07-01 09:03:56 +02:00
Kate Farrar
5fa6cdf1b2
[Metrics UI] [Logs UI] Updating alerts language in headers and Metrics (#103589)
* updating language in metrics ui to indicate rule type and updating language in header menu to Alerts and Rules
2021-06-30 14:40:33 -06:00
Caroline Horn
7d45fcf8ee
[Page layouts] Some light fixes (#103197)
* [Solution Toolbar] Fixing button border on non-text color versions

* [Alerts] Removed extra wrappers and use EuiPageHeader

* [Logstash] Basic conversion to template

* [Reporting] Adding bottomBorder to page header

* [ML] Fix display of main navigation tabs

* [Stack Management] Fix side nav not updating when going back to landing page

* [Tags] Add spacing after page header

* [License Management] Full width on file uploader

* [Page Template] Fixed `emptyState` default template for pages with side nav

* [Infra] Removing some page header displays in empty states

* [Enterprise Search] Fix some error layouts

* [Index Patterns] Quick fix for empty state

* snaps

* [Page Template] Remove forced padding when `centeredBody`

* small hack for tab padding for ml

* scroll ML page to fix test

* fix test method type signature

Co-authored-by: Dave Snider <dave.snider@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michail Yasonik <michail.yasonik@elastic.co>
2021-06-29 19:50:15 -05:00
ymao1
c05588f077
[Alerting] Enable rule import/export and allow rule types to exclude themselves from export (#102999)
* Removing feature flag changes

* Adding isExportable flag to rule type definition

* Adding isExportable flag to rule type definition

* Adding isExportable flag to rule type definition

* Filtering rule on export by rule type isExportable flag

* Fixing types

* Adding docs

* Fix condition when exportCount is 0

* Unit test for fix condition when exportCount is 0

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 20:35:27 -04:00