Commit graph

841 commits

Author SHA1 Message Date
Kibana Machine
842dad88bb
[8.8] [Infrastructure UI] Hosts View: Unified Search bar with auto-refresh enabled (#157011) (#159543)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Hosts View: Unified Search bar with auto-refresh
enabled (#157011)](https://github.com/elastic/kibana/pull/157011)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"dzheni.pavlova@elastic.co"},"sourceCommit":{"committedDate":"2023-06-13T08:07:58Z","message":"[Infrastructure
UI] Hosts View: Unified Search bar with auto-refresh enabled
(#157011)\n\nCloses #156690 \r\n\r\n## Summary\r\n\r\nThis PR adds a
flag (`isAutoRefreshDisabled`) to disable the default\r\nauto-refresh
option in the unified search.\r\n\r\n## Background\r\n\r\nThe auto
refresh is added by default when using a unified search bar
in\r\n[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)\r\nand
it appeared on the host view page when currently the
auto-refresh\r\noption is not supported.\r\n\r\n\r\n| with
`isAutoRefreshDisabled` (true) | without
`isAutoRefreshDisabled`\r\n(false/undefined) |\r\n|
------------------------------------
|\r\n-------------------------------------------------- |\r\n| <img
width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png\">\r\n|
<img width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png\">\r\n|\r\n\r\n---------\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"77d864e4ff04027f800789259fd6c6194b51c59a","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Infra
Monitoring
UI","release_note:skip","backport:prev-minor","v8.9.0"],"number":157011,"url":"https://github.com/elastic/kibana/pull/157011","mergeCommit":{"message":"[Infrastructure
UI] Hosts View: Unified Search bar with auto-refresh enabled
(#157011)\n\nCloses #156690 \r\n\r\n## Summary\r\n\r\nThis PR adds a
flag (`isAutoRefreshDisabled`) to disable the default\r\nauto-refresh
option in the unified search.\r\n\r\n## Background\r\n\r\nThe auto
refresh is added by default when using a unified search bar
in\r\n[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)\r\nand
it appeared on the host view page when currently the
auto-refresh\r\noption is not supported.\r\n\r\n\r\n| with
`isAutoRefreshDisabled` (true) | without
`isAutoRefreshDisabled`\r\n(false/undefined) |\r\n|
------------------------------------
|\r\n-------------------------------------------------- |\r\n| <img
width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png\">\r\n|
<img width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png\">\r\n|\r\n\r\n---------\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"77d864e4ff04027f800789259fd6c6194b51c59a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157011","number":157011,"mergeCommit":{"message":"[Infrastructure
UI] Hosts View: Unified Search bar with auto-refresh enabled
(#157011)\n\nCloses #156690 \r\n\r\n## Summary\r\n\r\nThis PR adds a
flag (`isAutoRefreshDisabled`) to disable the default\r\nauto-refresh
option in the unified search.\r\n\r\n## Background\r\n\r\nThe auto
refresh is added by default when using a unified search bar
in\r\n[defaultOnRefreshChange](https://github.com/elastic/kibana/blob/main/src/plugins/unified_search/public/search_bar/create_search_bar.tsx/#L59)\r\nand
it appeared on the host view page when currently the
auto-refresh\r\noption is not supported.\r\n\r\n\r\n| with
`isAutoRefreshDisabled` (true) | without
`isAutoRefreshDisabled`\r\n(false/undefined) |\r\n|
------------------------------------
|\r\n-------------------------------------------------- |\r\n| <img
width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862888-63efdb13-6b07-41c2-abe8-88247c9c96e1.png\">\r\n|
<img width=\"200\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/14139027/236862409-4f36ec6a-f274-4dae-960b-407ea30f330b.png\">\r\n|\r\n\r\n---------\r\n\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"77d864e4ff04027f800789259fd6c6194b51c59a"}}]}]
BACKPORT-->

Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
2023-06-13 02:17:35 -07:00
Kibana Machine
639d1a3f6f
[8.8] [Infrastructure UI] Filter control re-rendering problem fix (#159320) (#159458)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Filter control re-rendering problem fix
(#159320)](https://github.com/elastic/kibana/pull/159320)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-06-12T12:30:23Z","message":"[Infrastructure
UI] Filter control re-rendering problem fix (#159320)\n\nfixes
https://github.com/elastic/kibana/issues/159317 \r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem in the utilization of the
`ControlGroupRenderer`\r\ncomponent in the Hosts View. The problem
originated from the need to\r\nmanually compare changes in the
`filterPanel` object, to prevent the\r\npage from making duplicate
requests\r\n\r\n\r\nb38f5691-0519-4ae2-aab2-daaf0f72cd0d\r\n\r\nAfter
many changes that the code has been through, the comparison\r\nmentioned
above has become unnecessary.\r\n\r\n\r\n\r\n### How to test\r\n\r\n-
Start a local Kibana instance\r\n- Navigate to `Infrastructure >
Hosts`\r\n- Play with the filter controls (depending on how fast the
user is, it\r\nmight hang for a little while, but this won't slow the
whole page
down)","sha":"bcc4f11e0b97e991d94f5e6368dfa154f753d2ca","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:prev-minor","Feature:ObsHosts","v8.9.0"],"number":159320,"url":"https://github.com/elastic/kibana/pull/159320","mergeCommit":{"message":"[Infrastructure
UI] Filter control re-rendering problem fix (#159320)\n\nfixes
https://github.com/elastic/kibana/issues/159317 \r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem in the utilization of the
`ControlGroupRenderer`\r\ncomponent in the Hosts View. The problem
originated from the need to\r\nmanually compare changes in the
`filterPanel` object, to prevent the\r\npage from making duplicate
requests\r\n\r\n\r\nb38f5691-0519-4ae2-aab2-daaf0f72cd0d\r\n\r\nAfter
many changes that the code has been through, the comparison\r\nmentioned
above has become unnecessary.\r\n\r\n\r\n\r\n### How to test\r\n\r\n-
Start a local Kibana instance\r\n- Navigate to `Infrastructure >
Hosts`\r\n- Play with the filter controls (depending on how fast the
user is, it\r\nmight hang for a little while, but this won't slow the
whole page
down)","sha":"bcc4f11e0b97e991d94f5e6368dfa154f753d2ca"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159320","number":159320,"mergeCommit":{"message":"[Infrastructure
UI] Filter control re-rendering problem fix (#159320)\n\nfixes
https://github.com/elastic/kibana/issues/159317 \r\n\r\n##
Summary\r\n\r\nThis PR fixes a problem in the utilization of the
`ControlGroupRenderer`\r\ncomponent in the Hosts View. The problem
originated from the need to\r\nmanually compare changes in the
`filterPanel` object, to prevent the\r\npage from making duplicate
requests\r\n\r\n\r\nb38f5691-0519-4ae2-aab2-daaf0f72cd0d\r\n\r\nAfter
many changes that the code has been through, the comparison\r\nmentioned
above has become unnecessary.\r\n\r\n\r\n\r\n### How to test\r\n\r\n-
Start a local Kibana instance\r\n- Navigate to `Infrastructure >
Hosts`\r\n- Play with the filter controls (depending on how fast the
user is, it\r\nmight hang for a little while, but this won't slow the
whole page down)","sha":"bcc4f11e0b97e991d94f5e6368dfa154f753d2ca"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-06-12 06:38:40 -07:00
Kibana Machine
c6b775b4d8
[8.8] [Infrastructure UI] Remove sensitive info from telemetry payload (#159314) (#159366)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Remove sensitive info from telemetry payload
(#159314)](https://github.com/elastic/kibana/pull/159314)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-06-09T07:58:08Z","message":"[Infrastructure
UI] Remove sensitive info from telemetry payload (#159314)\n\n##
Summary\r\n\r\nThis PR changes the `Hosts View Query Submitted`
telemetry event\r\npayload, stopping Kibana from sending potentially
sensitive information\r\nto analytics services.\r\n\r\nAn example of the
new payload:\r\n\r\n```ts\r\n{\r\n control_filter_fields:
['host.os.name'],\r\n filter_fields: ['host.name',
'cloud.provider'],\r\n interval: 'interval(now-1h)',\r\n with_query:
false,\r\n limit: 100,\r\n}\r\n```\r\n\r\nInstead of sending filter
values, we'll pass only the field names.\r\nExcept for the query bar,
because it's to complicated to parse and\r\nretrieve that
information\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3bc3a362caa38427a849b2555ca0ad711bb870f1","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:prev-minor","Feature:ObsHosts","v8.9.0"],"number":159314,"url":"https://github.com/elastic/kibana/pull/159314","mergeCommit":{"message":"[Infrastructure
UI] Remove sensitive info from telemetry payload (#159314)\n\n##
Summary\r\n\r\nThis PR changes the `Hosts View Query Submitted`
telemetry event\r\npayload, stopping Kibana from sending potentially
sensitive information\r\nto analytics services.\r\n\r\nAn example of the
new payload:\r\n\r\n```ts\r\n{\r\n control_filter_fields:
['host.os.name'],\r\n filter_fields: ['host.name',
'cloud.provider'],\r\n interval: 'interval(now-1h)',\r\n with_query:
false,\r\n limit: 100,\r\n}\r\n```\r\n\r\nInstead of sending filter
values, we'll pass only the field names.\r\nExcept for the query bar,
because it's to complicated to parse and\r\nretrieve that
information\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3bc3a362caa38427a849b2555ca0ad711bb870f1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159314","number":159314,"mergeCommit":{"message":"[Infrastructure
UI] Remove sensitive info from telemetry payload (#159314)\n\n##
Summary\r\n\r\nThis PR changes the `Hosts View Query Submitted`
telemetry event\r\npayload, stopping Kibana from sending potentially
sensitive information\r\nto analytics services.\r\n\r\nAn example of the
new payload:\r\n\r\n```ts\r\n{\r\n control_filter_fields:
['host.os.name'],\r\n filter_fields: ['host.name',
'cloud.provider'],\r\n interval: 'interval(now-1h)',\r\n with_query:
false,\r\n limit: 100,\r\n}\r\n```\r\n\r\nInstead of sending filter
values, we'll pass only the field names.\r\nExcept for the query bar,
because it's to complicated to parse and\r\nretrieve that
information\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"3bc3a362caa38427a849b2555ca0ad711bb870f1"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-06-09 02:12:04 -07:00
Kibana Machine
e280aa0041
[8.8] [Logs UI] Fix Log Categorization UI failure due to infinite loop (#159090) (#159106)
# Backport

Closes #158930 

This will backport the following commits from `main` to `8.8`:
- [[Logs UI] Fix Log Categorization UI failure due to infinite loop
(#159090)](https://github.com/elastic/kibana/pull/159090)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2023-06-06T11:31:03Z","message":"[Logs
UI] Fix Log Categorization UI failure due to infinite loop
(#159090)\n\n## 📓 Summary\r\n\r\nWith the usage of the
`logViewReference` object (instead of the\r\nprimitive `sourceId`) as a
dependency for the log entries categories\r\ndata fetching, the
`useTrackedPromise` was continuously recreating
the\r\n`getLogEntryCategoryDatasets` and `getTopLogEntryCategories`
fetchers,\r\nwhich were consequently causing an infinite loop when
called inside the\r\nrelated side effect and used as
dependency.\r\n\r\nUsing the `logViewReference.logViewId` property
(equivalent to the\r\nlegacy `sourceId` string) restores the expected
behaviour.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"d6105d0bfe0634a0543e52ce3c1275ad0bd64250","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Logs
UI","Team:Infra Monitoring
UI","backport:prev-minor","v8.9.0"],"number":159090,"url":"https://github.com/elastic/kibana/pull/159090","mergeCommit":{"message":"[Logs
UI] Fix Log Categorization UI failure due to infinite loop
(#159090)\n\n## 📓 Summary\r\n\r\nWith the usage of the
`logViewReference` object (instead of the\r\nprimitive `sourceId`) as a
dependency for the log entries categories\r\ndata fetching, the
`useTrackedPromise` was continuously recreating
the\r\n`getLogEntryCategoryDatasets` and `getTopLogEntryCategories`
fetchers,\r\nwhich were consequently causing an infinite loop when
called inside the\r\nrelated side effect and used as
dependency.\r\n\r\nUsing the `logViewReference.logViewId` property
(equivalent to the\r\nlegacy `sourceId` string) restores the expected
behaviour.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"d6105d0bfe0634a0543e52ce3c1275ad0bd64250"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159090","number":159090,"mergeCommit":{"message":"[Logs
UI] Fix Log Categorization UI failure due to infinite loop
(#159090)\n\n## 📓 Summary\r\n\r\nWith the usage of the
`logViewReference` object (instead of the\r\nprimitive `sourceId`) as a
dependency for the log entries categories\r\ndata fetching, the
`useTrackedPromise` was continuously recreating
the\r\n`getLogEntryCategoryDatasets` and `getTopLogEntryCategories`
fetchers,\r\nwhich were consequently causing an infinite loop when
called inside the\r\nrelated side effect and used as
dependency.\r\n\r\nUsing the `logViewReference.logViewId` property
(equivalent to the\r\nlegacy `sourceId` string) restores the expected
behaviour.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"d6105d0bfe0634a0543e52ce3c1275ad0bd64250"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
2023-06-06 05:45:24 -07:00
Kibana Machine
6593d2318f
[8.8] [Infrastructure UI] Hosts view handle invalid KQL error (#156989) (#157418)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Hosts view handle invalid KQL error
(#156989)](https://github.com/elastic/kibana/pull/156989)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-11T16:59:23Z","message":"[Infrastructure
UI] Hosts view handle invalid KQL error (#156989)\n\ncloses
[#987](https://github.com/elastic/obs-infraobs-team/issues/987)\r\n\r\n##
Summary\r\n\r\nThis PR changes the hosts view to graciously handle
exceptions caused by\r\ninvalid KQL submissions\r\n\r\n<img
width=\"1451\"
alt=\"image\"\r\nsrc=\"5bafc987-9a14-4b03-9038-53179f7b6735\">\r\n\r\n\r\nBesides,
it changes the way it was handling a fatal error that can\r\nhappen if
something wrong happens while creating an ad-hoc data-view -\r\nthis is
highly unlike to happen, but we're standardizing how we
display\r\nerrors on the hosts view\r\n\r\n_Previously:_\r\n<img
width=\"1439\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/236833673-c994512f-cb73-441b-9783-506bab67ff4b.png\">\r\n\r\n_Now:_\r\n<img
width=\"1439\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/236862216-fada9f50-5d27-45b9-a6f3-8ac497a3e048.png\">\r\n\r\n###
How to test\r\n- Go to hosts view\r\n- Type invalid KQL expressions on
the search bar\r\n\r\n### For reviewer\r\n\r\nIf the page is loaded with
a querystring containing an invalid
`query`\r\n(e.g:\r\n`_a=(dateRange:(from:now-15m,to:now),filters:!(),limit:20,panelFilters:!(),query:(language:kuery,query:%27%7D%27)`),\r\nthe
Control components will show an error. However, they can't
recover\r\nfrom fatal errors. So even after the user corrects the
mistake in the\r\nquery, the controls will remain in the error
state.\r\n\r\nA ticket has been opened to address this
problem:\r\nhttps://github.com/elastic/kibana/issues/156430\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8baff25966d45c1b351e96a5cc524372b4dbdb29","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:prev-minor","Feature:ObsHosts","v8.9.0"],"number":156989,"url":"https://github.com/elastic/kibana/pull/156989","mergeCommit":{"message":"[Infrastructure
UI] Hosts view handle invalid KQL error (#156989)\n\ncloses
[#987](https://github.com/elastic/obs-infraobs-team/issues/987)\r\n\r\n##
Summary\r\n\r\nThis PR changes the hosts view to graciously handle
exceptions caused by\r\ninvalid KQL submissions\r\n\r\n<img
width=\"1451\"
alt=\"image\"\r\nsrc=\"5bafc987-9a14-4b03-9038-53179f7b6735\">\r\n\r\n\r\nBesides,
it changes the way it was handling a fatal error that can\r\nhappen if
something wrong happens while creating an ad-hoc data-view -\r\nthis is
highly unlike to happen, but we're standardizing how we
display\r\nerrors on the hosts view\r\n\r\n_Previously:_\r\n<img
width=\"1439\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/236833673-c994512f-cb73-441b-9783-506bab67ff4b.png\">\r\n\r\n_Now:_\r\n<img
width=\"1439\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/236862216-fada9f50-5d27-45b9-a6f3-8ac497a3e048.png\">\r\n\r\n###
How to test\r\n- Go to hosts view\r\n- Type invalid KQL expressions on
the search bar\r\n\r\n### For reviewer\r\n\r\nIf the page is loaded with
a querystring containing an invalid
`query`\r\n(e.g:\r\n`_a=(dateRange:(from:now-15m,to:now),filters:!(),limit:20,panelFilters:!(),query:(language:kuery,query:%27%7D%27)`),\r\nthe
Control components will show an error. However, they can't
recover\r\nfrom fatal errors. So even after the user corrects the
mistake in the\r\nquery, the controls will remain in the error
state.\r\n\r\nA ticket has been opened to address this
problem:\r\nhttps://github.com/elastic/kibana/issues/156430\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8baff25966d45c1b351e96a5cc524372b4dbdb29"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156989","number":156989,"mergeCommit":{"message":"[Infrastructure
UI] Hosts view handle invalid KQL error (#156989)\n\ncloses
[#987](https://github.com/elastic/obs-infraobs-team/issues/987)\r\n\r\n##
Summary\r\n\r\nThis PR changes the hosts view to graciously handle
exceptions caused by\r\ninvalid KQL submissions\r\n\r\n<img
width=\"1451\"
alt=\"image\"\r\nsrc=\"5bafc987-9a14-4b03-9038-53179f7b6735\">\r\n\r\n\r\nBesides,
it changes the way it was handling a fatal error that can\r\nhappen if
something wrong happens while creating an ad-hoc data-view -\r\nthis is
highly unlike to happen, but we're standardizing how we
display\r\nerrors on the hosts view\r\n\r\n_Previously:_\r\n<img
width=\"1439\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/236833673-c994512f-cb73-441b-9783-506bab67ff4b.png\">\r\n\r\n_Now:_\r\n<img
width=\"1439\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/236862216-fada9f50-5d27-45b9-a6f3-8ac497a3e048.png\">\r\n\r\n###
How to test\r\n- Go to hosts view\r\n- Type invalid KQL expressions on
the search bar\r\n\r\n### For reviewer\r\n\r\nIf the page is loaded with
a querystring containing an invalid
`query`\r\n(e.g:\r\n`_a=(dateRange:(from:now-15m,to:now),filters:!(),limit:20,panelFilters:!(),query:(language:kuery,query:%27%7D%27)`),\r\nthe
Control components will show an error. However, they can't
recover\r\nfrom fatal errors. So even after the user corrects the
mistake in the\r\nquery, the controls will remain in the error
state.\r\n\r\nA ticket has been opened to address this
problem:\r\nhttps://github.com/elastic/kibana/issues/156430\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"8baff25966d45c1b351e96a5cc524372b4dbdb29"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-05-11 11:08:49 -07:00
Kibana Machine
f6ac3f4ca3
[8.8] Fix the charts and group by section on the Log Threshold alert detail page (#155327) (#157410)
# Backport

This will backport the following commits from `main` to `8.8`:
- [Fix the charts and group by section on the Log Threshold alert detail
page (#155327)](https://github.com/elastic/kibana/pull/155327)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Chris
Cowan","email":"chris@elastic.co"},"sourceCommit":{"committedDate":"2023-05-11T15:54:35Z","message":"Fix
the charts and group by section on the Log Threshold alert detail page
(#155327)\n\n## Summary\r\n\r\nThis PR fixes #155083 with the following
changes:\r\n\r\n- Create a new field to store the action context for an
alert under\r\n`ALERT_CONTEXT` (`kibana.alert.context`) for Log
Threshold Rule.\r\n- Change the alert detail page to reference the
`groupByKeys` under\r\n`ALERT_CONTEXT` for the group by section\r\n-
Change the history chart to only display `12h` buckets\r\n\r\nI plan to
do a follow up PR to add the ALERT_CONTEXT to the other\r\nObservability
Rules which we will also need for our alert details pages.\r\n\r\n###
How to test\r\n\r\n1. Index data
using:\r\nhttps://github.com/elastic/high-cardinality-cluster/tree/main/high_cardinality_indexer\r\nby
running the following command:\r\n```\r\nDATASET=\"fake_stack\"
EVENTS_PER_CYCLE=1 INDEX_INTERVAL=60000
ELASTICSEARCH_HOSTS=http://localhost:9200 node src/run.js\r\n```\r\n2.
Create a DataView for named \"Admin Console\" with the index pattern
of\r\n`high-cardinality-data-fake_stack.admin-console-*` and the
timestamp\r\nfield set to `@timestamp`\r\n3. Go to the Log Stream in
Observability and change the index pattern to\r\n\"Admin Console\"\r\n4.
Create a rule that looks like:\r\n\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/41702/232578891-e65a3f1a-457c-459a-8d7f-cadc85e7067c.png\">\r\n\r\n5.
Create a rule WITHOUT a group by that will trigger and check
the\r\nalert detail page\r\n6. Create a rule with a ratio WITHOUT a
group by that will trigger and\r\ncheck the alert detail page\r\n7.
Create a rule with a ratio WITH a group by that will trigger
and\r\ncheck the alert detail
page\r\n\r\n---------\r\n\r\nCo-authored-by: Kevin Delemme
<kdelemme@gmail.com>\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"78671f113cc68f5e1696bbe4aed2320978c97e11","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
Actionable
Observability","v8.8.0","v8.9.0"],"number":155327,"url":"https://github.com/elastic/kibana/pull/155327","mergeCommit":{"message":"Fix
the charts and group by section on the Log Threshold alert detail page
(#155327)\n\n## Summary\r\n\r\nThis PR fixes #155083 with the following
changes:\r\n\r\n- Create a new field to store the action context for an
alert under\r\n`ALERT_CONTEXT` (`kibana.alert.context`) for Log
Threshold Rule.\r\n- Change the alert detail page to reference the
`groupByKeys` under\r\n`ALERT_CONTEXT` for the group by section\r\n-
Change the history chart to only display `12h` buckets\r\n\r\nI plan to
do a follow up PR to add the ALERT_CONTEXT to the other\r\nObservability
Rules which we will also need for our alert details pages.\r\n\r\n###
How to test\r\n\r\n1. Index data
using:\r\nhttps://github.com/elastic/high-cardinality-cluster/tree/main/high_cardinality_indexer\r\nby
running the following command:\r\n```\r\nDATASET=\"fake_stack\"
EVENTS_PER_CYCLE=1 INDEX_INTERVAL=60000
ELASTICSEARCH_HOSTS=http://localhost:9200 node src/run.js\r\n```\r\n2.
Create a DataView for named \"Admin Console\" with the index pattern
of\r\n`high-cardinality-data-fake_stack.admin-console-*` and the
timestamp\r\nfield set to `@timestamp`\r\n3. Go to the Log Stream in
Observability and change the index pattern to\r\n\"Admin Console\"\r\n4.
Create a rule that looks like:\r\n\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/41702/232578891-e65a3f1a-457c-459a-8d7f-cadc85e7067c.png\">\r\n\r\n5.
Create a rule WITHOUT a group by that will trigger and check
the\r\nalert detail page\r\n6. Create a rule with a ratio WITHOUT a
group by that will trigger and\r\ncheck the alert detail page\r\n7.
Create a rule with a ratio WITH a group by that will trigger
and\r\ncheck the alert detail
page\r\n\r\n---------\r\n\r\nCo-authored-by: Kevin Delemme
<kdelemme@gmail.com>\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"78671f113cc68f5e1696bbe4aed2320978c97e11"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155327","number":155327,"mergeCommit":{"message":"Fix
the charts and group by section on the Log Threshold alert detail page
(#155327)\n\n## Summary\r\n\r\nThis PR fixes #155083 with the following
changes:\r\n\r\n- Create a new field to store the action context for an
alert under\r\n`ALERT_CONTEXT` (`kibana.alert.context`) for Log
Threshold Rule.\r\n- Change the alert detail page to reference the
`groupByKeys` under\r\n`ALERT_CONTEXT` for the group by section\r\n-
Change the history chart to only display `12h` buckets\r\n\r\nI plan to
do a follow up PR to add the ALERT_CONTEXT to the other\r\nObservability
Rules which we will also need for our alert details pages.\r\n\r\n###
How to test\r\n\r\n1. Index data
using:\r\nhttps://github.com/elastic/high-cardinality-cluster/tree/main/high_cardinality_indexer\r\nby
running the following command:\r\n```\r\nDATASET=\"fake_stack\"
EVENTS_PER_CYCLE=1 INDEX_INTERVAL=60000
ELASTICSEARCH_HOSTS=http://localhost:9200 node src/run.js\r\n```\r\n2.
Create a DataView for named \"Admin Console\" with the index pattern
of\r\n`high-cardinality-data-fake_stack.admin-console-*` and the
timestamp\r\nfield set to `@timestamp`\r\n3. Go to the Log Stream in
Observability and change the index pattern to\r\n\"Admin Console\"\r\n4.
Create a rule that looks like:\r\n\r\n<img width=\"600\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/41702/232578891-e65a3f1a-457c-459a-8d7f-cadc85e7067c.png\">\r\n\r\n5.
Create a rule WITHOUT a group by that will trigger and check
the\r\nalert detail page\r\n6. Create a rule with a ratio WITHOUT a
group by that will trigger and\r\ncheck the alert detail page\r\n7.
Create a rule with a ratio WITH a group by that will trigger
and\r\ncheck the alert detail
page\r\n\r\n---------\r\n\r\nCo-authored-by: Kevin Delemme
<kdelemme@gmail.com>\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"78671f113cc68f5e1696bbe4aed2320978c97e11"}}]}]
BACKPORT-->

Co-authored-by: Chris Cowan <chris@elastic.co>
2023-05-11 10:03:34 -07:00
Kibana Machine
d927533c49
[8.8] [Infrastructure UI] Host limit telemetry (#155726) (#157409)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Host limit telemetry
(#155726)](https://github.com/elastic/kibana/pull/155726)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-11T15:44:38Z","message":"[Infrastructure
UI] Host limit telemetry (#155726)\n\ncloses:
https://github.com/elastic/kibana/issues/155567\r\n\r\n##
Summary\r\n\r\nThis PR adds a new custom event to track the total number
of hosts, as\r\nwell as adjusts a few `data-test-subj` attribute values
to meet the\r\nnaming convention defined in the
observability-dev\r\n[docs](https://github.com/elastic/observability-dev/blob/main/docs/how-we-work/telemetry/telemetry-convention.md#naming-convention)\r\n\r\n\r\n###
For Reviewers\r\n\r\nAn option for not allowing yet a new custom event
in FS could be\r\ntriggering the new custom events only for self-managed
customers, and in\r\nFS watch the element that holds the total number of
hosts. But for now,\r\nI decided to allow the new custom event in FS for
consistency\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"937912b056f5876247f27a7baad5314401e65939","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:prev-minor","Feature:ObsHosts","v8.9.0"],"number":155726,"url":"https://github.com/elastic/kibana/pull/155726","mergeCommit":{"message":"[Infrastructure
UI] Host limit telemetry (#155726)\n\ncloses:
https://github.com/elastic/kibana/issues/155567\r\n\r\n##
Summary\r\n\r\nThis PR adds a new custom event to track the total number
of hosts, as\r\nwell as adjusts a few `data-test-subj` attribute values
to meet the\r\nnaming convention defined in the
observability-dev\r\n[docs](https://github.com/elastic/observability-dev/blob/main/docs/how-we-work/telemetry/telemetry-convention.md#naming-convention)\r\n\r\n\r\n###
For Reviewers\r\n\r\nAn option for not allowing yet a new custom event
in FS could be\r\ntriggering the new custom events only for self-managed
customers, and in\r\nFS watch the element that holds the total number of
hosts. But for now,\r\nI decided to allow the new custom event in FS for
consistency\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"937912b056f5876247f27a7baad5314401e65939"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155726","number":155726,"mergeCommit":{"message":"[Infrastructure
UI] Host limit telemetry (#155726)\n\ncloses:
https://github.com/elastic/kibana/issues/155567\r\n\r\n##
Summary\r\n\r\nThis PR adds a new custom event to track the total number
of hosts, as\r\nwell as adjusts a few `data-test-subj` attribute values
to meet the\r\nnaming convention defined in the
observability-dev\r\n[docs](https://github.com/elastic/observability-dev/blob/main/docs/how-we-work/telemetry/telemetry-convention.md#naming-convention)\r\n\r\n\r\n###
For Reviewers\r\n\r\nAn option for not allowing yet a new custom event
in FS could be\r\ntriggering the new custom events only for self-managed
customers, and in\r\nFS watch the element that holds the total number of
hosts. But for now,\r\nI decided to allow the new custom event in FS for
consistency\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"937912b056f5876247f27a7baad5314401e65939"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-05-11 10:01:52 -07:00
Dario Gieselaar
91074624cf
[8.8] [Logs/APM] Get context menu items from triggers (#157131) (#157381)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Logs/APM] Get context menu items from triggers
(#157131)](https://github.com/elastic/kibana/pull/157131)

<!--- Backport version: 7.3.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT {commits} BACKPORT-->
2023-05-11 06:19:45 -07:00
Kibana Machine
251123c4bb
[8.8] [Infrastructure UI] Fix Lens charts for APM hosts (#156372) (#156390)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infrastructure UI] Fix Lens charts for APM hosts
(#156372)](https://github.com/elastic/kibana/pull/156372)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-02T13:56:06Z","message":"[Infrastructure
UI] Fix Lens charts for APM hosts (#156372)\n\n## Summary\r\n\r\nAfter
the implementation of the new API and host limit, all charts now\r\nload
only after the table is loaded. This PR changes the filters the\r\npage
currently passes to Lens, to pass only a list of host names, the\r\nsame
way Alerts and Logs tabs do it.\r\n\r\nThis also fixes a problem where
filters remove documents containing\r\nmetrics data.\r\n\r\n\r\n<img
width=\"772\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/235683301-35709698-49c2-4871-a724-2d2ca662f3f2.png\">\r\n\r\n<img
width=\"772\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/235683956-f7170213-afbd-400d-a190-a02087831af1.png\">\r\n\r\n\r\n\r\n\r\n###
How to test\r\n\r\n- Connect your local kibana to an oblt cluster\r\n-
Go to Hosts view\r\n- Filter by `service.name:
\"opbeans-java\"`","sha":"e9804277b20320e37dde3ceaaa6f9ae1b66e3b23","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:prev-minor","Feature:ObsHosts","v8.9.0"],"number":156372,"url":"https://github.com/elastic/kibana/pull/156372","mergeCommit":{"message":"[Infrastructure
UI] Fix Lens charts for APM hosts (#156372)\n\n## Summary\r\n\r\nAfter
the implementation of the new API and host limit, all charts now\r\nload
only after the table is loaded. This PR changes the filters the\r\npage
currently passes to Lens, to pass only a list of host names, the\r\nsame
way Alerts and Logs tabs do it.\r\n\r\nThis also fixes a problem where
filters remove documents containing\r\nmetrics data.\r\n\r\n\r\n<img
width=\"772\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/235683301-35709698-49c2-4871-a724-2d2ca662f3f2.png\">\r\n\r\n<img
width=\"772\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/235683956-f7170213-afbd-400d-a190-a02087831af1.png\">\r\n\r\n\r\n\r\n\r\n###
How to test\r\n\r\n- Connect your local kibana to an oblt cluster\r\n-
Go to Hosts view\r\n- Filter by `service.name:
\"opbeans-java\"`","sha":"e9804277b20320e37dde3ceaaa6f9ae1b66e3b23"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156372","number":156372,"mergeCommit":{"message":"[Infrastructure
UI] Fix Lens charts for APM hosts (#156372)\n\n## Summary\r\n\r\nAfter
the implementation of the new API and host limit, all charts now\r\nload
only after the table is loaded. This PR changes the filters the\r\npage
currently passes to Lens, to pass only a list of host names, the\r\nsame
way Alerts and Logs tabs do it.\r\n\r\nThis also fixes a problem where
filters remove documents containing\r\nmetrics data.\r\n\r\n\r\n<img
width=\"772\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/235683301-35709698-49c2-4871-a724-2d2ca662f3f2.png\">\r\n\r\n<img
width=\"772\"
alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/2767137/235683956-f7170213-afbd-400d-a190-a02087831af1.png\">\r\n\r\n\r\n\r\n\r\n###
How to test\r\n\r\n- Connect your local kibana to an oblt cluster\r\n-
Go to Hosts view\r\n- Filter by `service.name:
\"opbeans-java\"`","sha":"e9804277b20320e37dde3ceaaa6f9ae1b66e3b23"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-05-02 08:04:07 -07:00
Kibana Machine
595cc3fbd0
[8.8] [Infarstructure UI] Fix hosts view functional test (#155772) (#156360)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[Infarstructure UI] Fix hosts view functional test
(#155772)](https://github.com/elastic/kibana/pull/155772)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Carlos
Crespo","email":"crespocarlos@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-02T11:40:48Z","message":"[Infarstructure
UI] Fix hosts view functional test (#155772)\n\ncloses
https://github.com/elastic/kibana/issues/155429\r\ncloses
https://github.com/elastic/kibana/issues/155293\r\n\r\n##
Summary\r\n\r\n\r\nThis PR fixes the hosts view functional test,
stabilizing the flaky test\r\ncases that started to fail after changes
were made to the page\r\n\r\n\r\n### How to test\r\n\r\n- `yarn
test:ftr:server
--config\r\nx-pack/test/functional/apps/infra/config.ts`\r\n- `yarn
test:ftr:runner --config\r\nx-pack/test/functional/apps/infra/config.ts
--include\r\nx-pack/test/functional/apps/infra/hosts_view.ts`\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c4669323f7a1a781eaa2eaddab74971c480c80e8","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:prev-minor","Feature:ObsHosts","v8.9.0"],"number":155772,"url":"https://github.com/elastic/kibana/pull/155772","mergeCommit":{"message":"[Infarstructure
UI] Fix hosts view functional test (#155772)\n\ncloses
https://github.com/elastic/kibana/issues/155429\r\ncloses
https://github.com/elastic/kibana/issues/155293\r\n\r\n##
Summary\r\n\r\n\r\nThis PR fixes the hosts view functional test,
stabilizing the flaky test\r\ncases that started to fail after changes
were made to the page\r\n\r\n\r\n### How to test\r\n\r\n- `yarn
test:ftr:server
--config\r\nx-pack/test/functional/apps/infra/config.ts`\r\n- `yarn
test:ftr:runner --config\r\nx-pack/test/functional/apps/infra/config.ts
--include\r\nx-pack/test/functional/apps/infra/hosts_view.ts`\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c4669323f7a1a781eaa2eaddab74971c480c80e8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155772","number":155772,"mergeCommit":{"message":"[Infarstructure
UI] Fix hosts view functional test (#155772)\n\ncloses
https://github.com/elastic/kibana/issues/155429\r\ncloses
https://github.com/elastic/kibana/issues/155293\r\n\r\n##
Summary\r\n\r\n\r\nThis PR fixes the hosts view functional test,
stabilizing the flaky test\r\ncases that started to fail after changes
were made to the page\r\n\r\n\r\n### How to test\r\n\r\n- `yarn
test:ftr:server
--config\r\nx-pack/test/functional/apps/infra/config.ts`\r\n- `yarn
test:ftr:runner --config\r\nx-pack/test/functional/apps/infra/config.ts
--include\r\nx-pack/test/functional/apps/infra/hosts_view.ts`\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c4669323f7a1a781eaa2eaddab74971c480c80e8"}}]}]
BACKPORT-->

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-05-02 05:52:38 -07:00
Marco Antonio Ghiani
13517601d5
[Infrastructure UI] Create InventoryViewsService and InventoryViewsClient (#155126)
## 📓 Summary

Depends on #154900
Closes #155110 

This PR implements the `InventoryViewsService` and
`InventoryViewsClient`, injecting an instance of the client in the
KibanaContextForPlugin and exposing so a set of utilities to
retrieve/update inventory views:
- `findInventoryViews`
- `getInventoryView`
- `createInventoryView`
- `updateInventoryView`
- `deleteInventoryView`

## 👣 Next steps
- Implement #154725 to consume the service

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-26 10:50:26 +02:00
Marco Antonio Ghiani
c6fa0f9e09
[Infrastructure UI] Prepare saved view components to consume new view hooks (#155174)
## 📓  Summary

Part of #152617 

This PR does some refactoring on the presentational components used to
render the saved views on both Infra Inventory and Metrics Explorer,
preparing for the additional work required once [[Infrastructure UI]
Saved object hooks that use the SO client are removed in favour of the
new endpoints#154725](https://github.com/elastic/kibana/issues/154725)
will be implemented.

## 🐞 Bug fixes

While working on this code, some pre-existing issues have been
discovered and fixed:
- "Make default" star icon was not aligned correctly when rendered
alone:
<img width="751" alt="Screenshot 2023-04-19 at 15 22 24"
src="https://user-images.githubusercontent.com/34506779/233088425-34992395-4d18-46bc-9124-5d99101406ce.png">

- Delete view confirm prompt not closed after removing a view:


https://user-images.githubusercontent.com/34506779/233088780-9b1bfe57-170c-4e66-9303-f41448eb8447.mov

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-25 17:20:16 +02:00
Lisa Cawley
fb68f2075a
[DOCS] Automate two rule management screenshots (#155566) 2023-04-25 08:11:22 -07:00
jennypavlova
460e9a707c
[Infrastructure UI] Telemetry: Host view flyout - Add / Remove filter (#155511)
Closes [#155415](https://github.com/elastic/kibana/issues/155415)
## Summary

This PR adds telemetry for the flyout add/remove filter events

# Testing

- Open the hosts view flyout, select the metadata tab and add/remove a
filter from there
- Check in the network tab - there should be a request to the telemetry
cluster including the events:
<img width="2126" alt="image"
src="https://user-images.githubusercontent.com/14139027/233965729-58fd6266-7851-48e5-acf0-e395b4fd7ebe.png">

- It should be also visible in
[FS](https://app.fullstory.com/ui/1397FY/home) under API events (for
some reason I don't see the events made from my machine in FS at all so
I couldn't check it there)
2023-04-25 03:56:43 -07:00
jennypavlova
f1fe2c49af
[Infra UI] Only show 'Hosts' tour when in 'hosts' view (#155619)
Closes #155590
## Summary

This PR shows hosts tour only when "hosts" is selected in the `Show`
menu

## Testing

- Go to Inventory page
- Select hosts (default if not changed)
   - You should see the hosts tour
 
<img width="2223" alt="image"
src="https://user-images.githubusercontent.com/14139027/234004293-4720cbed-a120-467a-beb5-1c57ed1cc87e.png">

- Select anything else (for example Kubernetes Pods, Docker Containers)
   - You shouldn't see  the hosts tour
  
<img width="2232" alt="image"
src="https://user-images.githubusercontent.com/14139027/234004468-d5cac8e6-42dc-4d37-954d-18b32cdd0552.png">

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-25 11:41:05 +02:00
Maryam Saeidi
dfea483ef2
[AO] Add threshold information to the metric threshold alert details page (#155493)
Closes #153740, closes #153833, closes #155593

This PR adds threshold information and rule name to the metric threshold
alert details page.


![image](https://user-images.githubusercontent.com/12370520/233968325-8a66166b-2534-4b9b-9054-9085270db5f6.png)


## 🧪 How to test
- Add xpack.observability.unsafe.alertDetails.metrics.enabled: true to
the Kibana config
- Create a metric threshold rule with multiple conditions that generates
an alert
- Go to the alert details page and check threshold information
- Click on the rule link; it should send you to the rule page
2023-04-25 02:14:47 -07:00
Carlos Crespo
06545277d7
[Infrastructure UI] Replace Snapshot API with InfraMetrics API in Hosts View (#155531)
closes [#154443](https://github.com/elastic/kibana/issues/154443)
## Summary

This PR replaces the usage of the Snapshot API in favor of the new
`metrics/infra` endpoint and also includes a new control in the Search
Bar to allow users to select how many hosts they want the API to return.


https://user-images.githubusercontent.com/2767137/233728658-bccc7258-6955-47fb-8f7b-85ef6ec5d0f9.mov

Because the KPIs now needs to show an "Average (of X hosts)", they will
only start fetching the data once the table has been loaded.

The hosts count KPI tile was not converted to Lens, because the page
needs to know the total number of hosts.

### Possible follow-up

Since now everything depends on the table to be loaded, I have been
experimenting with batched requests to the new API. The idea is to fetch
at least the host names as soon as possible.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-24 15:02:44 -03:00
Carlos Crespo
54457b074a
[Infrastructure UI] Plot metric charts data based on current page items (#155249)
closes [#152186](https://github.com/elastic/kibana/issues/152186)

## Summary

This PR makes the metric charts show data for the hosts on the current
page. With this change, the charts will **only** load after the table
has finished loading its data - or after Snapshot API has responded

It also changes the current behavior of the table pagination and
sorting. Instead of relying on the `EuiInMemoryTable` the pagination and
sorting are done manually, and the EuiInMemoryTable has been replaced by
the `EuiBasicTable`.

The loading indicator has also been replaced.

Paginating and sorting:


https://user-images.githubusercontent.com/2767137/233161166-2bd719e1-7259-4ecc-96a7-50493bc6c0a3.mov

Open in lens 


https://user-images.githubusercontent.com/2767137/233161134-621afd76-44b5-42ab-b58c-7f51ef944ac2.mov


### How to test
- Go to Hosts view
- Paginate and sort the table data
- Select a page size and check if the select has been stored in the
localStorage (`hostsView:pageSizeSelection` key)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-24 11:13:57 -03:00
Maryam Saeidi
b71f7831d8
[AO] Sync chart pointers on the metric threshold alert details page (#155402)
Closes #155354

## Summary

This PR syncs chart pointers on the metric threshold alert details page.


![image](https://user-images.githubusercontent.com/12370520/233380782-bf97eab8-167d-4f97-a10d-d2bfec1936e7.png)


## 🧪 How to test

- Add `xpack.observability.unsafe.alertDetails.metrics.enabled: true` to
the Kibana config
- Create a metric threshold rule with multiple conditions that generates
an alert
- Go to the alert details page and check the chart pointers
2023-04-24 15:22:56 +02:00
jennypavlova
f5034e60a5
[Infrastructure UI] Hosts view remove flyout state from the url after the flyout is closed (#155317)
Closes #154564

## Summary

This PR removes the flyout state from the URL if the flyout is closed
and set the default state if the flyout is open again

## Testing

- Open a single host flyout and change the tab/add filter or search (do
not close the flyout yet)
- Copy the URL and verify that you see the same flyout data in a new
browser tab/window
- Close the flyout
   - Check the URL (the flyout state should not be there)
- Copy the URL and verify that you see the flyout data is not there
(flyout is still closed and when it's open it has default state
(metadata page open)
- if there are any metadata filters applied they should still be part of
the unified search bar


https://user-images.githubusercontent.com/14139027/233397203-d99fc04a-a118-43f8-a43b-6b01d34ab3b8.mov
2023-04-24 12:17:37 +02:00
Devon Thomson
ffc349225e
[Analyst Experience Components] Dashboard & Control Group APIs (#150121)
Aligns the Portable Dashboard renderer and the Control Group renderer to a new API structure using `useImperativeHandle` rather than the overcomplicated and mostly unused wrapper provider system.
2023-04-19 15:34:39 -04:00
Marco Antonio Ghiani
b40b89e711
[Logs UI] Redirect Logs UI to Discover when in serverless mode (#154145)
## 📓 Summary

Closes #153890

The implementation creates a new LogsApp service where we should keep
any logic concerned with what `target_app` parameter is configured and
the actions related to a specific configuration. I thought it could be a
good approach to avoid drilling down the global config till we need it
and keep it cleaner by injecting only the service with predefined
actions.

In this first case, we create a redirect to discover using its locator,
and the exposed method can be used anywhere across the app for
triggering the redirect.

## 🧪 Testing

### Normal behaviour

When Kibana is used as always, we want to keep the current behaviour and
the user will stay on the Logs UI pages.
- Launch the Kibana dev environment with `yarn start`
- Navigate to Logs UI
- Verify the navigation works normally and that no redirect to Discover
occurs

### Serverless behaviour

When Kibana is used in serverless mode, we want to redirect any user
landing to Logs UI to the Discover page, configuring the same data view
or creating an ad-hoc one starting from the index pattern
- Launch the Kibana dev environment with `yarn serverless-oblt`
- Navigate to Logs UI
- Verify to be redirected to Discover and a temporary data view is
created from the current index pattern

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-19 08:30:45 -07:00
Carlos Crespo
fce3664397
[Infrastructure UI] KPI charts with Lens Embeddable (#154903)
## Summary

This PR replaces all but Host Count metric charts with Lens and aligns
the formulas used in Lens with the formulas used in the Snapshot API.

The Hosts Count was not converted yet, because Snapshot API
[post-process the results and filters out hosts that don't have metrics
and come from
APM](47c71b3025/x-pack/plugins/infra/server/routes/snapshot/lib/transform_metrics_ui_response.ts (L61)).
I decided to keep it unchanged until we start using a new API, which
won't have that step.

In order to avoid multiple requests going to the server simultaneously,
I introduced an intersection observer in the Lens chart component. It
will make them only trigger a request once the user has scrolled over a
chart component. This aims to prevent the occurrence of
`circuit_breaking_exception` exceptions when async_search has to process
too much data.

### Differences between Lens and current KPI charts

<img width="533" alt="image"
src="https://user-images.githubusercontent.com/2767137/232526591-4812059e-ba1f-4e59-a060-820570230084.png">

Currently, Lens doesn't provide an option for adding a suffix to the
metric value nor set a max number of decimal places. (e.g (e.g 3.8 Mbit
**/s**)

### For reviewer

Unfortunately, it's a big PR. Everything in the `lens/formulas` folder
is just related to the metric formulas that are reused between KPIs and
Metrics Charts.

The core of the changes is in the `lens/visualization_types` folder. It
contains the details on how to build different objects to render either
a metric type of chart or a lineXY one.

I have also aligned `cpu` and `memory` formulas with what we have in the
Inventory Model. When comparing the current KPI with the new ones in
Lens Embeddable, the results were not matching.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-19 11:04:51 -03:00
jennypavlova
25df1feee3
[Infrastructure UI] Hosts View: Filtering by metadata functionality (#155170)
Closes #151010

## Summary

This PR adds filtering functionality to the metadata table. After some
discussions there are changes in the design - see the [last
comments](https://github.com/elastic/kibana/issues/151010#issuecomment-1513005095)

## Additional changes

As the filters will change the order I changed the id to not depend on
the table index anymore (used os instead) inside [hosts table

](https://github.com/elastic/kibana/pull/155170/files#diff-168ba138bc6696100078e3e9cbc438ed7646d6336e9ef85a9c88553c9d8956f5)

## Testing
- Open the single host view for one of the hosts available in the table
- Inside the flyout select the Metadata tab
- Click on any of the available filter icons to add a filter 
- Check if the filter is applied and a toast is displayed
- Click on the same filter icon to remove it and check that it is
removed
- If there are other filters applied they should combined with the
metadata filters (so if filter A is added and then a metadata filter is
applied both filters should be visible)



https://user-images.githubusercontent.com/14139027/232837814-7292c7ec-8b63-4172-bcd9-2d49daf3b145.mov
2023-04-19 14:21:26 +02:00
Marco Antonio Ghiani
56459aed58
[Infrastructure UI] Dinamically set sticky bar position for Hosts View (#155139)
## 📓  Summary

Closes #155114

Instead of having a fixed value for the sticky bar position, we now set
it accordingly to the top position of the main app container.


https://user-images.githubusercontent.com/34506779/232760797-c91f8ade-b1bc-4921-9ef7-30d4647219b5.mov

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-04-18 05:14:53 -07:00
Marco Antonio Ghiani
e472ed5fba
[Logs UI]: Fix log error on fetching previous entries (#154459)
## 📓 Summary

Closes #151700 

As shown in the video on [this
comment](https://github.com/elastic/kibana/issues/151700#issuecomment-1497246729),
the issue was reproduced when jumping to the lowest possible edge of the
available logs in the lateral timeline.
In case there are no existing logs before the selected time cursor, the
`topCursor` value required for the previous logs call is set to `null`
and the error was triggered.

I believe in this case the conditional to trigger the error should not
only rely on the missing `topCursor` variable existence, but we should
also check whether previous logs exist with the `hasMoreBefore` state
value.

These are the conditionals in order of execution:
- Top cursor missing but has more previous entries ➡️ trigger the Error
- No more previous entries and the request is not forced ➡️ Short
circuit data fetching
- Top cursor exists => Trigger the request for previous entries.

These changes also spotted an existing bug where the `hasMoreBefore` was
never set to the API response value, but was always `true`, preventing
also showing the "Expand time range" call to action on the scenario
described above.

## 🧪 Testing

- Navigate to Logs stream
- Jump to a point in time that has no logs previously ingested
- Verify the error is not logged when scrolling and that the "extend
range" button is shown


https://user-images.githubusercontent.com/34506779/230292210-c2690c37-efa1-4b05-a237-f14eb78d26eb.mov

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-04-18 12:03:24 +02:00
Faisal Kanout
01c0d0152c
[AO] - Add logs threshold ratio chart to the alert details page (#155024)
## Summary

It fixes #155022 by adding the new ratio chart

<img width="1197" alt="Screenshot 2023-04-17 at 16 17 45"
src="https://user-images.githubusercontent.com/6838659/232513836-3ac2e18b-a1d6-404b-aaa7-9670d3ea0fff.png">

### Checklist

Delete any items that are not applicable to this PR.

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

---------
2023-04-17 09:21:39 -07:00
Coen Warmer
54646146d7
Use Observability Page Template from Observability Shared in Infra (#154778)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-17 05:10:59 -07:00
Faisal Kanout
89e8d03e6b
[AO] - Add rule-specific fields, threshold, and reuse alert details package components (#154569)
## Summary
It fixes #153675, fixes #153567,
fixes #153946, fixes #154845

<img width="1603" alt="Screenshot 2023-04-11 at 17 40 38"
src="https://user-images.githubusercontent.com/6838659/231215968-63b9ab6d-3b82-47c6-ace9-347306283b2a.png">

---------
2023-04-13 05:40:03 -07:00
jennypavlova
5a03c5d710
[Infrastructure UI] Hosts view flyout metadata search (#154556)
Closes #154347 

## Summary

This PR adds search functionality to the metadata tab.
In order to optimize the search I changed the table to
`EuiInMemoryTable` and handled the search there. One benefit is that
table filtering is the responsibility of the table and the cases to
handle errors/no data found are much easier.
<img width="2435" alt="Screenshot 2023-04-06 at 15 36 35"
src="https://user-images.githubusercontent.com/14139027/230400195-b77b7783-9c4d-48b0-85e6-cb38180a29d3.png">

<img width="2434" alt="Screenshot 2023-04-06 at 15 58 22"
src="https://user-images.githubusercontent.com/14139027/230400337-1013626c-c802-4b45-88f1-bff67f0ec37e.png">

This also helped to get rid of some of the callouts condition and leave
the table component to decide what to render based on the items and
loading state. That way the loading looks much smoother rather than
replacing the table with a loading component - also when loading and
there are no results the loading indicator is inside the table.

![image](https://user-images.githubusercontent.com/14139027/230401218-04871ce9-ceba-4803-8259-7978c4152ee9.png)

## Testing
1. Open the flyout for a single host
2. On the metadata tab start searching
    a. Try to search for field name/value - should get a result
b. Do a typo with an invalid character (or just enter only ```, `+`,
etc) - an error message should be displayed (and ⚠️ icon in the search
bar)
c. Try to search for something that it's not a field name/value - should
display the `No metadata found.` message in the table.
3. Copy a URL after searching for something and paste it into a new
browser tab/window - it should persist the search term. (In case of a
search error the search filter is not persisted)



https://user-images.githubusercontent.com/14139027/230400149-6ba4dc32-efaa-4068-8abb-24b6ae43de76.mov
2023-04-12 13:49:56 +02:00
Marco Antonio Ghiani
42000ba733
[Infrastructure UI] Update host filter management to sync with AlertSummary (#154373)
## 📓 Summary

Closes #153360 

To correctly sync the brush selection with the time service there was
the need for a refactor on how we handle the host filters, simplifying a
bit the code implementation and re-using existing abstractions.

## 🧪 Testing

- Navigate to Hosts View
- Create an Inventory Alert that can easily trigger
- Reload the search until the alerts are triggered
- Click on the alerts tab to preview them
- Select a time range on the chart and see the changes reflected on the
chart and the time range globally applied.


https://user-images.githubusercontent.com/34506779/230015011-1b48deba-7c05-47df-80b1-37e8ee046b05.mov

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-04-11 00:22:47 -07:00
Chris Cowan
1af1ff1a4d
Add additional types to the fields to be use with cardinality aggregation for Metric Threshold Rule (#154197)
## Summary

This PR closed #152655 by allowing the following types `['number',
'string', 'ip', 'date']` to be used with the cardinality aggregation. I
also changed the type for `validNormalizedTypes` to a union of the valid
keys instead of just a string, in the name of better Typescript
autocomplete.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-06 09:32:03 -06:00
Maryam Saeidi
234f09b18d
[AO] Fix annotation key (#154550)
## Summary
This PR fixes the following warning about not having a key for all
annotations.

<img
src="https://user-images.githubusercontent.com/12370520/230372611-ce2c93bb-c5b4-40ad-b704-3b6779bb4d13.png"
width="500px" />
2023-04-06 06:46:33 -07:00
jennypavlova
8c2ff54c96
[Infrastructure UI] Hosts view: Add links to apm and uptime for a single host (#154269)
Closes #150985 

## Summary

This PR adds links to APM Traces and Uptime.
<img width="1909" alt="image"
src="https://user-images.githubusercontent.com/14139027/229580612-a3d0c03a-4f68-4b09-b333-ffa79c8454e6.png">

# Testing
1. Open Hosts view 
2. Click on the button to open the flyout for a single host
- Click on the APM traces link and verify the query parameters are
correct
- Click on the uptime link and verify the query parameters are correct
   


https://user-images.githubusercontent.com/14139027/229581672-3c50ea55-e834-4431-aac6-3ed3ff9f96cc.mov

---------

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2023-04-06 03:23:03 -07:00
Maryam Saeidi
7dba0145ac
[AO] Add alert time range annotation for metric threshold (#154440)
Resolves #153851

## Summary

This PR adds alert time range annotation for the metric threshold rule
details page.


![image](https://user-images.githubusercontent.com/12370520/230080136-434bb586-c00e-4f36-aa11-525a38f8a650.png)
**Note**
I changed the rule criteria to stop the alert, hence the weird graph!

## 🧪 How to test
1. Add `xpack.observability.unsafe.alertDetails.metrics.enabled: true`
to the Kibana config
2. Generate a metric threshold alert
3. Go to the related alert details page and check the annotation
2023-04-06 00:33:53 +02:00
Maryam Saeidi
6350e146fa
[AO] Metric threshold alert details - custom time range and alert start annotation (#153954)
Closes #153202, closes #153850

## Summary

This PR adds alert start annotation and also uses a custom time range
for the alert details' charts depending on the alert duration. The logic
to calculate the time range was added in a separate package to be used
in other use cases as well.


![image](https://user-images.githubusercontent.com/12370520/228583927-bf90cc13-53d5-4824-9b3b-ed6e6ffd06f5.png)

## 🧪 How to test

Create a metric threshold alert and go to the related alert details
page, verify:
- Alert start annotation
- The time range of the charts should be before the alert was started
(1/8 of the duration was added to each side)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-04 09:08:27 -07:00
Faisal Kanout
e57c853329
[AO] - Add chart series filter capability for the Logs Alert Details page (#154335)
## Summary

It closes #154262 

### Before:

![](https://user-images.githubusercontent.com/6838659/229560256-e8965afd-fd45-4451-9b45-4496a477283b.png)


### After, we can filter the shown series on the chart alert-based


![](https://user-images.githubusercontent.com/6838659/229560443-279d26a7-a3dd-4ebb-8371-c6e35d50c555.png)
2023-04-04 16:16:30 +02:00
jennypavlova
ef4afdd64d
[Infrastructure UI] Show processes on a single hosts (#153866)
Closes #150907

## Summary
This PR adds the Processes tab to the single host flyout. The component
is already implemented in Inventory so we can reuse it here

## Testing
- Go to hosts view
- Open the flyout for any host to see the single host details
- Click on the processes tab 
⚠️ If you want to see the processes summary on top (where the total
processes are displayed) you need inside your metricbeat modules yml
configuration to include the `process_summary` so your config should
include:
```
metricbeat.modules:
  - module: system
    metricsets:
      ..... other data  .......
      - process # Per process metrics
      - process_summary # Process summary
    ..... other data  .......
```
<img width="1913" alt="image"
src="https://user-images.githubusercontent.com/14139027/228534978-c38437e4-4279-4ad4-9fc8-5222cbd15c2e.png">

---------

Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-04-03 19:24:11 +02:00
Faisal Kanout
64d53bde6e
[AO] - Add Logs history chart to the Logs Alert Details page (#153930)
## Summary

It closes #150854 by

- Add optional annotations to the prereview chart
- Add the Logs history chart 

<img width="941" alt="Screenshot 2023-03-29 at 17 09 36"
src="https://user-images.githubusercontent.com/6838659/228584016-f73efef0-03e6-4777-b2df-17f13166c77b.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/main/packages/kbn-i18n/README.md)
2023-04-03 08:03:10 -07:00
Marco Antonio Ghiani
77ce676518
[Infrastructure UI] Fix time range filter in alerts query (#153863)
## 📓 Summary

Closes #153741 

This PR fixes the time range filter by using the
`kibana.alert.time_range` field instead of `@timestamp`.

## 🧪 Testing

- Navigate to Hosts View
- Create an Inventory Alert that will trigger immediately
- Refresh the search until some alerts are triggered
- Play with relative time range (eg. 15 min ago -> 2 min ago) to verify
alerts appears correctly

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-04-03 02:20:51 -07:00
Kerry Gallagher
684203944c
[Logs UI] Make URL syncing optional in the Log View state machine (#154061)
## Summary

This fixes https://github.com/elastic/kibana/issues/154030 (and other
uses of the Log Stream embeddable component).

The embeddable component calls `useLogView()` directly, and this causes
issues with context dependencies for URL syncing from the consumers.

This PR makes the URL actions / services optional within the machine. 

Uses:

- `<LogViewProvider />` used for all main Logs pages (stream, anomalies,
categories) has full URL syncing 
- `<LogViewProvider />` used within our Logs alert editor does not have
URL syncing (not needed) 
- `useLogView()` as used by the embeddable component does not have URL
syncing 
- `useLogView()` as used by `RedirectToNodeLogs` does not have URL
syncing (not needed, URL syncing kicks in after redirect) 

The default / pure implementation of `initializeFromUrl` just does a
`send({ type: 'INITIALIZED_FROM_URL', logViewReference: null })` as the
state machine needs to transition to it's `initialized` state and is
already set up to use the initial context reference if there's no
reference obtained from the URL.

Examples:

![Screenshot 2023-03-30 at 15 23
48](https://user-images.githubusercontent.com/471693/228867868-b526c4b2-bec8-47cb-8e7c-c3da2dd6c803.png)

![Screenshot 2023-03-30 at 15 24
39](https://user-images.githubusercontent.com/471693/228867889-c7451f84-415c-45f9-ae96-e6908d60409c.png)
2023-03-31 13:47:44 +01:00
Marco Antonio Ghiani
9a3e646789
[Infrastructure UI] Additional functional tests Hosts View (#154026)
## 📓 Summary

Closes #147691 

- Test hosts table content.
- Test to verify the search results hosts to propagate the filter to
other sections.
- Test Logs tab existence, to add a test for logs content once
https://github.com/elastic/kibana/issues/154030 is resolved.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-03-30 12:30:44 +02:00
Christos Nasikas
a47a3e1db7
[RAM] Cases bulk actions & column improvements (#151761)
## Summary

This PR:
- Moves the case bulk actions from the solutions to the alert table
- Refetch when using the case row actions & the case bulk actions.
- Renames the `kibana.alert.case_ids` label to `Cases`
- Unskip the `alerts_table.test.tsx` test file and skip the individual
flaky tests. I run the test file 60 times in the CI without any issues
(9efed89ee9)
- Renames the cases flyout and modal hook from `get*` to `use*`

Fixes: https://github.com/elastic/kibana/issues/151688

## Userflow

## Testing

### Alerts table

- The alerts table does not show the Cases column by default
- You can choose the case column from the fields modal. Type `Case` to
find the cases column
- The label of the column is `Cases`
- The label of the field in the fields modal is `Cases`
- You can bulk attach alerts to a new case
- You can bulk attach alerts to an existing case
- When bulk attaching alerts to a case the alerts table re-fetches the
data
- When attaching an alert to a case from the row actions the alerts
table re-fetches the data

### Case integrations outside the alerts table
- Ensure that you can attach your data to a case (existing and new)

### Checklist

Delete any items that are not applicable to this PR.

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

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-29 10:45:18 -07:00
Kerry Gallagher
4c586a71d4
[Logs UI] Support inline Log Views in the UI (#152933)
## Summary

This closes #142840. It is the UI portion of support for inline Log
Views.

## Visible changes to the UI

### ML warning

![Screenshot 2023-03-10 at 14 55
34](https://user-images.githubusercontent.com/471693/224348959-8db70d91-dc8b-4f4e-926b-ec05e7481b78.png)

### Alert dropdown warning

![Screenshot 2023-03-10 at 14 55
43](https://user-images.githubusercontent.com/471693/224349026-cdf17767-225a-4ecd-af8a-b90e2a21816f.png)


### Settings page warning

![Screenshot 2023-03-10 at 14 56
02](https://user-images.githubusercontent.com/471693/224349066-bcb63ba8-fee8-4b7a-b41b-7d89e09f002a.png)


## Reviewer hints / notes

- The ACs on the issue are quite extensive and should provide a good
number of things to test.
  - Make use of the "playground" page (see below) to make this easier
 
- The `AlertDropdown` has been made lazy as the page load bundle
increased by 100kb otherwise.

- Our `link-to` functionality is scoped to persisted Log Views only at
the moment as historically they've only accepted a path segment, not
full query parameters. We can look to extend this in the future once we
have concrete linking needs.

## Questions

- I have allowed the Log View client to handle both the inline and
persisted Log Views. I wonder if the function names become confusing?
(e.g. are the RESTful prefixes misleading now?).

- The ML warning splash page links to settings to revert to a persisted
Log View. It could also be done in place on the page. I went back and
forth over whether we should keep the reverting in one place?


## Testing

There is now a "state machine playground" available at the following
URL: `/app/logs/state-machine-playground`, it is enabled in developer
mode only. It's not fancy or pretty it just serves to make testing
things easier. There are various buttons, e.g. `Switch to inline Log
View`, to facilitate easier testing whilst a Log View switcher is not in
the UI itself. You can utilise these buttons, and then head to other
pages to ensure things are working correctly, e.g. warning callouts and
disabled buttons etc. If you'd like to play with the options used, e.g.
for `update`, amend the code within `state_machine_playground.tsx`. It's
also useful just to sit on this page, try various things, and verify
what happens in the developer tools (does the context update correctly
etc).

## Known issues

- When saving on the settings page we actually revert to a "Loading data
sources" state. This is also the case on `main`. The reason for this is
the check within settings looks like so:

```ts
if ((isLoading || isUninitialized) && !resolvedLogView) {
    return <SourceLoadingPage />;
}
```

but the `resolvedLogView` state matching looks like so:

```ts
const resolvedLogView = useSelector(logViewStateService, (state) =>
    state.matches('checkingStatus') ||
    state.matches('resolvedPersistedLogView') ||
    state.matches('resolvedInlineLogView')
      ? state.context.resolvedLogView
      : undefined
  );
```

so even though we have resolved a Log View previously the state matching
overrides this. I'd prefer to follow this up in a separate issue as I'd
like to think through the ramifications a bit more. It's not a bug, but
it is jarring UX.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-03-29 14:15:39 +01:00
Maryam Saeidi
843b0e6a10
[AO] Add Threshold component (#153374)
Part of #153238

## Summary

This PR adds a new component called Threshold to be used on the alert
details page.
You can check the `storybook > infra > alerting > Threshold` for this
component.
([storybook](https://ci-artifacts.kibana.dev/storybooks/pr-153374/50f671b2c16dd0dc2ab631add4fb690d3092c100/infra/index.html?path=/story/infra-alerting-threshold--default))


![image](https://user-images.githubusercontent.com/12370520/227933732-1d392d33-2ce5-4236-bc3a-8f82ebe91649.png)
2023-03-29 02:03:32 -07:00
Marco Antonio Ghiani
f17457b86e
[Infrastructure UI] Fix inventory table pagination navigation (#153849)
## 📓 Summary

Closes #153739 

Each time the whole inventory table was rerendering due to a click on an
entry, a new list of items was regenerated, reinitializing the in-memory
table component from the first page.

Memoizing the generated items solves the issue and the table work as
expected.

This PR also solve another issue occurring when multiple table entries
were clicked, which resulted in many popovers opened and a blocked UI as
per the following screenshot:

<img width="1267" alt="multi-popover"
src="https://user-images.githubusercontent.com/34506779/228196645-9c0444b7-9114-47c2-8e5d-0bec29ed5305.png">

## 🧪 Testing
- Navigate to `Inventory` and select the `Kubernetes Pods` option from
the **Show** filter.
- Switch the view to a table with the top-right selector
- Verify the popover correctly opens on any entry of the first table
page, then switch to different pages and check the behaviour is
maintained and there are no reinitializations for the table.
- Verify the same from the `Docker Containers` list.



https://user-images.githubusercontent.com/34506779/228198613-afafe3fe-f714-4c88-a288-fc4c95ca801a.mov

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
2023-03-29 00:44:24 -07:00
Faisal Kanout
c1a8b90f51
[AO] - Add scaffolding and the main chart to the Logs threshold Alert Details page (#153081)
## Summary
### This is a kickoff PR; more PRs will follow up. 

It closes #152738
<img width="1191" alt="Screenshot 2023-03-23 at 13 10 09"
src="https://user-images.githubusercontent.com/6838659/227239913-4516cf44-92f6-454c-a7af-72dafb12cfb6.png">


### Checklist

Delete any items that are not applicable to this PR.

- [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/main/packages/kbn-i18n/README.md)
- [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
2023-03-28 18:15:47 +02:00
mohamedhamed-ahmed
d6a67452f3
[Infrastructure UI] Fix wrong requests sent in the logs tab flyout (#153763)
closes  #152831 
## Summary

This PR replaces useThrottle with useDebounce in the logs tab to make
sure that we are sending correct requests matching what is typed in the
search field.

### Testing

1. Go to Inventory page
2. Click on any host to open the flyout
3. Go to logs tab and type `message:total` in the search bar
4. Quickly delete the last 2 characters and check the request sent you
will notice it correctly has `message:tot` in the filters
2023-03-28 11:00:27 +01:00
mohamedhamed-ahmed
cd96ab465b
[Infrastructure UI] Integrated the logs tab to the Hosts View (#152995)
closes [#957](https://github.com/elastic/obs-infraobs-team/issues/957)
closes [#958](https://github.com/elastic/obs-infraobs-team/issues/958)
closes [#959](https://github.com/elastic/obs-infraobs-team/issues/959)

## Summary

This PR is for integrating the logs tab in the Hosts view and adding a
search bar to allow further filtering the logs, it also enables
navigating to the Logs stream view using an Open in logs link.

## Demo


https://user-images.githubusercontent.com/11225826/226317269-c35a292f-095d-4c15-94ea-13fc75f07102.mov

## Next Steps

1. Implementing Telemetry
2. Functional Tests

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <carloshenrique.leonelcrespo@elastic.co>
2023-03-27 11:22:07 +01:00
jennypavlova
d06d2a3bc9
[Infrastructure UI] Flyout metadata tests (#153683)
## Summary

Related to #150893

This PR adds tests for the flyout feature. Most of the changes are
adding test ids and helpers and the actual tests you can see in
[metadata.test.tsx](https://github.com/elastic/kibana/pull/153581/files#diff-c7a7e518f3cd536c1f63e64dfce04673790b7c4b80f78a60a6934dd14bbf402b)
and [hosts view functional
test](https://github.com/elastic/kibana/pull/153581/files#diff-cdf2ef63d7f0db051d569b09fbd2ba39eb852d3d75bf3b29d85e57de2da3af35R178)

### Functional Test 
Added a check for open/close of the flyout and metadata tab title
visibility - this can be expanded when the filtering functionality is
added

### Component Test
As we have many cases based on the metadata response I added a separate
test for the `metadata` component. Usually, we don't have this approach
but some cases like the error/no data case are hard to cover only with a
functional test.
2023-03-27 12:07:22 +02:00