A change in the ES range agg no longer accepts numbers with decimals if the underlying field is typed as long. This PR fixes the issue by rounding the percentiles values we pass on to the range agg.
Co-authored-by: Walter Rafelsberger <walter@elastic.co>
* Fix error when searchin with special characters in policies filter
* remove unused brackets
* Refactor test uses userEvent instead of fireEvent to supress act() usage
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: David Sánchez <davidsansol92@gmail.com>
* Add column-gap to HeaderSectionComponent
* Please code review by using gutterSize instead of flex column-gap
* Add eui-textBreakNormal to header_section title
It makes sure that words in the title don't break into a new line
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
* [ILM] Fixed ILM a11y test by creating a snapshot repo that is now required in the ILM API
* [ILM] Fixed functional test by creating a snapshot repository
* [ILM] Updated the params after es client update
* [ILM] Added filtering by policy name to the a11y test to find the correct ILM policy in the list
* [ILM] Added filtering by policy name to the a11y test to find the correct ILM policy in the list
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [ML] Retain _meta on clone
* [ML] Fix validation on schema to only check it it's defined/not null
* [ML] Remove validation because es should handle the validation already
* Change type to unknown
Co-authored-by: Quynh Nguyen <43350163+qn895@users.noreply.github.com>
* Set `keep_policies_up_to_date` during preconfiguration
Don't rely on only our 7.16 migration set this flag, ensure it gets set
to `true` for any package that appears in `DEFAULT_PACKAGES` during
preconfiguration
Closes#116982
* Move default logic to installation
* Revert conflict change in preconfiguration.ts
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
Previously, we were only honoring the "keep policies up to date"
setting for policies generated during preconfiguration. This fix ensure
we honor it for all policies.
Closes#116435
Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
* Disable agent monitoring settings in UI for managed policies
* Allow namespace to be changed for preconfigured managed policies
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jen Huang <its.jenetic@gmail.com>
* clean up IField API
* disable switch when using MVTs for es docs
* clean up interface comment style
* implement supportsFieldMetaFromEs and supportsFieldMetaFromLocalData in all Field classes
* fix dynamic_color_property test
* fix jest tests
* mock getRangeFieldMeta instead of passing in VectorLayerMock with MockStyle
* review feedback
* clean up supportsFieldMetaFromLocalData test
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nathan Reese <reese.nathan@gmail.com>
* use event.ingested for datastream last activity
* remove ms precision from datastream dates
* add timestamp check to test
* fix type error
* split test out to be less complex and more reliable 🤞
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
* New DescriptionField component for artifact cards
* Use new DescriptionField in ArtifactCardEntry
* Added `eui-textBreakWord` class name to TextValueDisplay component in artifact cards
* Use `DescriptionField` in `CardCompressedHeader`
* Fix i18n of Description label on minified card
* Use DescriptionField in ArtifactEntryMinified
Co-authored-by: Paul Tavares <56442535+paul-tavares@users.noreply.github.com>
**Ticket:** https://github.com/elastic/kibana/issues/106469, https://github.com/elastic/kibana/issues/101013
## Summary
TL;DR: New internal endpoint for reading data from Event Log (raw version), legacy status SO under the hood.
With this PR we now read the Failure History (last 5 failures) on the Rule Details page from Event Log. We continue getting the Current Status from the legacy `siem-detection-engine-rule-status` saved objects. Rule Management page also gets data from the legacy saved objects.
- [x] Deprecate existing methods for reading data in `IRuleExecutionLogClient`: `.find()` and `.findBulk()`
- [x] Introduce new methods for reading data in IRuleExecutionLogClient:
- for reading last N execution events for 1 rule from event log
- for reading current status and metrics for 1 rule from legacy status SOs
- for reading current statuses and metrics for N rules from legacy status SOs
- [x] New methods should return data in the legacy status SO format.
- [x] Update all the existing endpoints that depend on `IRuleExecutionLogClient` to use the new methods.
- [x] Implement a new internal endpoint for fetching current status of the rule execution and execution events from Event Log for a given rule.
- [x] The API of the new endpoint should be the same as `rules/_find_statuses` to minimise changes in the app.
- [x] Use the new endpoint on the Rule Details page.
## Near-term plan for technical implementation of the Rule Execution Log (https://github.com/elastic/kibana/issues/101013)
**Stage 1. Reading last 5 failures from Event Log v1 - raw implementation** - ✔️ done in this PR
TL;DR: New internal endpoint for reading data from Event Log (raw version), legacy status SO under the hood.
- Deprecate existing methods for reading data in `IRuleExecutionLogClient`: `.find()` and `.findBulk()`
- Introduce new methods for reading data in IRuleExecutionLogClient:
- for reading last N execution events for 1 rule from event log
- for reading current status and metrics for 1 rule from legacy status SOs
- for reading current statuses and metrics for N rules from legacy status SOs
- New methods should return data in the legacy status SO format.
- Update all the existing endpoints that depend on `IRuleExecutionLogClient` to use the new methods.
- Implement a new internal endpoint for fetching current status of the rule execution and execution events from Event Log for a given rule.
- The API of the new endpoint should be the same as `rules/_find_statuses` to minimise changes in the app.
- Use the new endpoint on the Rule Details page.
**Stage 2: Reading last 5 failures from Event Log v2 - clean implementation**
TL;DR: Clean HTTP API, legacy Rule Status SO under the hood.
🚨🚨🚨 Possible breaking changes in Detections API 🚨🚨🚨
- Design a new data model for the Current Rule Execution Info (the TO-BE new SO type and later the TO-BE data in the rule object itself).
- Design a new data model for the Rule Execution Event (read model to be used on the Rule Details page)
- Think over changes in `IRuleExecutionLogClient` to support the new data model.
- Think over changes in all the endpoints that return any data related to rule monitoring (statuses, metrics, etc). Make sure to check our docs to identify what's documented there regarding rule monitoring.
- Update `IRuleExecutionLogClient` to return data in the new format.
- Update all the endpoints (including the raw new one) to return data in the new format.
- Update Rule Details page to consume data in the new format.
- Update Rule Management page to consume data in the new format.
**Stage 3: Reading last 5 failures from Event Log v3 - new SO**
TL;DR: Clean HTTP API, new Rule Execution Info SO under the hood.
- Implement a new SO type for storing the current rule execution info. Relation type: 1 rule - 1 current execution info.
- Swap the legacy SO with the new SO in the implementation of `IRuleExecutionLogClient`.
**Stage 4: Cleanup and misc**
- Revisit the problem of deterministic ordering ([comment](https://github.com/elastic/kibana/pull/115574#discussion_r735803087))
- Remove rule execution log's glue code: adapters, feature switch.
- Remove the legacy rule status SO.
- Mark the legacy rule status SO as deleted in Kibana Core.
- Encapsulate the current space id in the instance of IRuleExecutionLogClient. Remove it from parameters of its methods.
- Introduce a Rule Execution Logger scoped to a rule instance. For use in rule executors.
- Add test coverage.
### 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: Georgii Gorbachev <georgii.gorbachev@elastic.co>
* Fix all broken stories
* In stories that were broken, add an associated Jest test so they if they break in the future we'll know
* Fix all console.error messages that were being printed during Jest test runs
* Add test setup which makes it so `console.error` throws an error so tests will fail if error console messages are printed
# Conflicts:
# x-pack/plugins/apm/public/components/shared/backend_link.stories.tsx
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>