Commit graph

980 commits

Author SHA1 Message Date
Kibana Machine
33bc977a8a
[8.6] [Fix][Infrastructure UI] Incorrect payload in time range when landing on the Hosts View (#147390) (#147424)
# Backport

This will backport the following commits from `main` to `8.6`:
- [[Fix][Infrastructure UI] Incorrect payload in time range when landing
on the Hosts View
(#147390)](https://github.com/elastic/kibana/pull/147390)

<!--- 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":"2022-12-13T09:43:15Z","message":"[Fix][Infrastructure
UI] Incorrect payload in time range when landing on the Hosts View
(#147390)\n\nCloses #146581 \r\n\r\n## Summary\r\n\r\nThis PR fixes the
initial `from` date range calculation. The idea is to\r\nconvert first
the initial range of minutes to milliseconds. Then in\r\norder to get
the date of `CALCULATED_DATE_RANGE_TO` - (the calculated\r\ninitial
range in milliseconds) and call `getTime()` to receive the\r\ncalculated
`from` date as timestamp.\r\n\r\nTo test that you can open the host page
without the time range in the\r\nURL. Then check the `from` value as in
the screenshot attached to the\r\nstory and you can use an [Unix
timestamp\r\nconverter](https://www.unixtimestamp.com/) to verify that
the\r\ncalculation is
correct","sha":"29841da10b140d8bb0e24d5af4c55e64b6f473c9","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Infra
Monitoring
UI","backport:prev-minor","v8.7.0"],"number":147390,"url":"https://github.com/elastic/kibana/pull/147390","mergeCommit":{"message":"[Fix][Infrastructure
UI] Incorrect payload in time range when landing on the Hosts View
(#147390)\n\nCloses #146581 \r\n\r\n## Summary\r\n\r\nThis PR fixes the
initial `from` date range calculation. The idea is to\r\nconvert first
the initial range of minutes to milliseconds. Then in\r\norder to get
the date of `CALCULATED_DATE_RANGE_TO` - (the calculated\r\ninitial
range in milliseconds) and call `getTime()` to receive the\r\ncalculated
`from` date as timestamp.\r\n\r\nTo test that you can open the host page
without the time range in the\r\nURL. Then check the `from` value as in
the screenshot attached to the\r\nstory and you can use an [Unix
timestamp\r\nconverter](https://www.unixtimestamp.com/) to verify that
the\r\ncalculation is
correct","sha":"29841da10b140d8bb0e24d5af4c55e64b6f473c9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147390","number":147390,"mergeCommit":{"message":"[Fix][Infrastructure
UI] Incorrect payload in time range when landing on the Hosts View
(#147390)\n\nCloses #146581 \r\n\r\n## Summary\r\n\r\nThis PR fixes the
initial `from` date range calculation. The idea is to\r\nconvert first
the initial range of minutes to milliseconds. Then in\r\norder to get
the date of `CALCULATED_DATE_RANGE_TO` - (the calculated\r\ninitial
range in milliseconds) and call `getTime()` to receive the\r\ncalculated
`from` date as timestamp.\r\n\r\nTo test that you can open the host page
without the time range in the\r\nURL. Then check the `from` value as in
the screenshot attached to the\r\nstory and you can use an [Unix
timestamp\r\nconverter](https://www.unixtimestamp.com/) to verify that
the\r\ncalculation is
correct","sha":"29841da10b140d8bb0e24d5af4c55e64b6f473c9"}}]}]
BACKPORT-->

Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
2022-12-13 04:12:13 -07:00
Kibana Machine
28991d49d8
[8.6] [Infrastructure UI] Improve metrics settings error handling (#146272) (#146675)
# Backport

This will backport the following commits from `main` to `8.6`:
- [[Infrastructure UI] Improve metrics settings error handling
(#146272)](https://github.com/elastic/kibana/pull/146272)

<!--- 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":"2022-11-30T10:54:37Z","message":"[Infrastructure
UI] Improve metrics settings error handling (#146272)\n\nCloses
[#145238](https://github.com/elastic/kibana/issues/145238)\r\n\r\n##
Summary\r\n\r\nThese changes add validation to the Metric Indices passed
into the\r\nMetrics settings page.\r\nNew validation is added both in
the UI and in the endpoint, performing\r\nthe following checks:\r\n-
Index pattern is not an empty string\r\n- Index pattern does not contain
empty spaces (start, middle, end) (the\r\npattern is not trimmed)\r\n-
Index pattern does not contain empty entries, comma-separated
values\r\nshould have an acceptable value.\r\n\r\nIn case the value is
not valid, the UI will render an appropriate error\r\nmessage.\r\nIf the
`PATCH /api/metrics/source/{sourceId}` request to update the\r\nvalue is
manually sent with an invalid value, the server will respond\r\nwith a
400 status code and an error message.\r\n\r\nAlso, for retro
compatibility and to not block the user when the\r\nconfiguration can't
be successfully retrieved, in case of internal error\r\nthe `GET
/api/metrics/source/{sourceId}` will return a 404 and on the\r\nUI,
instead of rendering a blank page, the user will see the empty
form\r\nand will be able to re-insert the right values.\r\n\r\n##
Testing\r\n\r\nNavigate to `Inventory`-> Click on `Settings` on the
topbar -> Start\r\nwriting different metric indices in the Metric
Indices field.\r\n\r\n### Editing Metric Indices
validation\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\r\n\r\n###
Missing/Broken configuration
response\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:all-open","v8.7.0"],"number":146272,"url":"https://github.com/elastic/kibana/pull/146272","mergeCommit":{"message":"[Infrastructure
UI] Improve metrics settings error handling (#146272)\n\nCloses
[#145238](https://github.com/elastic/kibana/issues/145238)\r\n\r\n##
Summary\r\n\r\nThese changes add validation to the Metric Indices passed
into the\r\nMetrics settings page.\r\nNew validation is added both in
the UI and in the endpoint, performing\r\nthe following checks:\r\n-
Index pattern is not an empty string\r\n- Index pattern does not contain
empty spaces (start, middle, end) (the\r\npattern is not trimmed)\r\n-
Index pattern does not contain empty entries, comma-separated
values\r\nshould have an acceptable value.\r\n\r\nIn case the value is
not valid, the UI will render an appropriate error\r\nmessage.\r\nIf the
`PATCH /api/metrics/source/{sourceId}` request to update the\r\nvalue is
manually sent with an invalid value, the server will respond\r\nwith a
400 status code and an error message.\r\n\r\nAlso, for retro
compatibility and to not block the user when the\r\nconfiguration can't
be successfully retrieved, in case of internal error\r\nthe `GET
/api/metrics/source/{sourceId}` will return a 404 and on the\r\nUI,
instead of rendering a blank page, the user will see the empty
form\r\nand will be able to re-insert the right values.\r\n\r\n##
Testing\r\n\r\nNavigate to `Inventory`-> Click on `Settings` on the
topbar -> Start\r\nwriting different metric indices in the Metric
Indices field.\r\n\r\n### Editing Metric Indices
validation\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\r\n\r\n###
Missing/Broken configuration
response\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146272","number":146272,"mergeCommit":{"message":"[Infrastructure
UI] Improve metrics settings error handling (#146272)\n\nCloses
[#145238](https://github.com/elastic/kibana/issues/145238)\r\n\r\n##
Summary\r\n\r\nThese changes add validation to the Metric Indices passed
into the\r\nMetrics settings page.\r\nNew validation is added both in
the UI and in the endpoint, performing\r\nthe following checks:\r\n-
Index pattern is not an empty string\r\n- Index pattern does not contain
empty spaces (start, middle, end) (the\r\npattern is not trimmed)\r\n-
Index pattern does not contain empty entries, comma-separated
values\r\nshould have an acceptable value.\r\n\r\nIn case the value is
not valid, the UI will render an appropriate error\r\nmessage.\r\nIf the
`PATCH /api/metrics/source/{sourceId}` request to update the\r\nvalue is
manually sent with an invalid value, the server will respond\r\nwith a
400 status code and an error message.\r\n\r\nAlso, for retro
compatibility and to not block the user when the\r\nconfiguration can't
be successfully retrieved, in case of internal error\r\nthe `GET
/api/metrics/source/{sourceId}` will return a 404 and on the\r\nUI,
instead of rendering a blank page, the user will see the empty
form\r\nand will be able to re-insert the right values.\r\n\r\n##
Testing\r\n\r\nNavigate to `Inventory`-> Click on `Settings` on the
topbar -> Start\r\nwriting different metric indices in the Metric
Indices field.\r\n\r\n### Editing Metric Indices
validation\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\r\n\r\n###
Missing/Broken configuration
response\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
2022-11-30 05:00:48 -07:00
Kibana Machine
1b2ce1a5a8
[8.6] Fixes issue in sorting using TX and RX columns (#145994) (#146509)
# Backport

This will backport the following commits from `main` to `8.6`:
- [Fixes issue in sorting using TX and RX columns
(#145994)](https://github.com/elastic/kibana/pull/145994)

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

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

<!--BACKPORT
[{"author":{"name":"mohamedhamed-ahmed","email":"eng_mohamedhamed@hotmail.com"},"sourceCommit":{"committedDate":"2022-11-29T09:41:18Z","message":"Fixes
issue in sorting using TX and RX columns (#145994)\n\n##
Summary\r\ncloses #142667\r\nMore details about the issue can be
found\r\n[here](https://github.com/elastic/kibana/issues/142667)\r\n\r\n##
Problem \r\n\r\nThe problem here is the use of bucket script in the
query which doesn't\r\nreturn a single metric value and thus can't be
used for pipeline\r\naggregation.\r\n```\r\nbucket_script: {\r\n
buckets_path: {\r\n value: 'rx_avg',\r\n period: 'rx_period>period',\r\n
},\r\n script: {\r\n source: 'params.value / (params.period /
1000)',\r\n lang: 'painless',\r\n },\r\n gap_policy: 'skip'\r\n
}\r\n```\r\n\r\n## Proposed Solutions:\r\n\r\n1.
Using\r\n[Runtime](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html)\r\nfield
as below:\r\n```\r\n\"runtime_mappings\": {\r\n \"rx_bytes_per_period\":
{\r\n \"type\": \"long\",\r\n \"script\": {\r\n \"source\": \"\"\"\r\n
emit(doc['host.network.ingress.bytes'].size()==0 ? -1 :
(doc['host.network.ingress.bytes'].value/doc['metricset.period'].value));\r\n
\"\"\"\r\n }\r\n }\r\n }\r\n```\r\n\r\n2.
Using\r\n[Scripted_Metric](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html):\r\n\r\n```\r\nscripted_metric\":
{\r\n \"init_script\": \"state.bytes_per_period = []\",\r\n
\"map_script\":
\"state.bytes_per_period.add(doc['host.network.ingress.bytes'].value/(doc['metricset.period'].value/1000))\",\r\n
\"combine_script\": \"double avg_bytes_per_period = 0; for (t in
state.bytes_per_period) { avg_bytes_per_period += t } return
avg_bytes_per_period/state.bytes_per_period.size()\",\r\n
\"reduce_script\": \"double result = 0; for (a in states) { result += a)
} return result/states.size()\"\r\n }\r\n```\r\n\r\n##
Conclusion\r\n\r\nI decided to go with the runtime field as its a bit
more concise and\r\neasier to understand and performance wise it was
slightly faster than\r\nthe scripted metric in most times.\r\n\r\n###
Testing\r\n\r\nNavigate to `Observability` -> `Overview` -> `Hosts
Table` try to filter\r\nwith Rx and Tx
columns","sha":"6e4f22d12dfc18ceff35b9bd0f6038b7fbf5ec7b","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Infra
Monitoring UI","Feature:Observability
Overview","backport:prev-minor","v8.7.0"],"number":145994,"url":"https://github.com/elastic/kibana/pull/145994","mergeCommit":{"message":"Fixes
issue in sorting using TX and RX columns (#145994)\n\n##
Summary\r\ncloses #142667\r\nMore details about the issue can be
found\r\n[here](https://github.com/elastic/kibana/issues/142667)\r\n\r\n##
Problem \r\n\r\nThe problem here is the use of bucket script in the
query which doesn't\r\nreturn a single metric value and thus can't be
used for pipeline\r\naggregation.\r\n```\r\nbucket_script: {\r\n
buckets_path: {\r\n value: 'rx_avg',\r\n period: 'rx_period>period',\r\n
},\r\n script: {\r\n source: 'params.value / (params.period /
1000)',\r\n lang: 'painless',\r\n },\r\n gap_policy: 'skip'\r\n
}\r\n```\r\n\r\n## Proposed Solutions:\r\n\r\n1.
Using\r\n[Runtime](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html)\r\nfield
as below:\r\n```\r\n\"runtime_mappings\": {\r\n \"rx_bytes_per_period\":
{\r\n \"type\": \"long\",\r\n \"script\": {\r\n \"source\": \"\"\"\r\n
emit(doc['host.network.ingress.bytes'].size()==0 ? -1 :
(doc['host.network.ingress.bytes'].value/doc['metricset.period'].value));\r\n
\"\"\"\r\n }\r\n }\r\n }\r\n```\r\n\r\n2.
Using\r\n[Scripted_Metric](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html):\r\n\r\n```\r\nscripted_metric\":
{\r\n \"init_script\": \"state.bytes_per_period = []\",\r\n
\"map_script\":
\"state.bytes_per_period.add(doc['host.network.ingress.bytes'].value/(doc['metricset.period'].value/1000))\",\r\n
\"combine_script\": \"double avg_bytes_per_period = 0; for (t in
state.bytes_per_period) { avg_bytes_per_period += t } return
avg_bytes_per_period/state.bytes_per_period.size()\",\r\n
\"reduce_script\": \"double result = 0; for (a in states) { result += a)
} return result/states.size()\"\r\n }\r\n```\r\n\r\n##
Conclusion\r\n\r\nI decided to go with the runtime field as its a bit
more concise and\r\neasier to understand and performance wise it was
slightly faster than\r\nthe scripted metric in most times.\r\n\r\n###
Testing\r\n\r\nNavigate to `Observability` -> `Overview` -> `Hosts
Table` try to filter\r\nwith Rx and Tx
columns","sha":"6e4f22d12dfc18ceff35b9bd0f6038b7fbf5ec7b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145994","number":145994,"mergeCommit":{"message":"Fixes
issue in sorting using TX and RX columns (#145994)\n\n##
Summary\r\ncloses #142667\r\nMore details about the issue can be
found\r\n[here](https://github.com/elastic/kibana/issues/142667)\r\n\r\n##
Problem \r\n\r\nThe problem here is the use of bucket script in the
query which doesn't\r\nreturn a single metric value and thus can't be
used for pipeline\r\naggregation.\r\n```\r\nbucket_script: {\r\n
buckets_path: {\r\n value: 'rx_avg',\r\n period: 'rx_period>period',\r\n
},\r\n script: {\r\n source: 'params.value / (params.period /
1000)',\r\n lang: 'painless',\r\n },\r\n gap_policy: 'skip'\r\n
}\r\n```\r\n\r\n## Proposed Solutions:\r\n\r\n1.
Using\r\n[Runtime](https://www.elastic.co/guide/en/elasticsearch/reference/current/runtime.html)\r\nfield
as below:\r\n```\r\n\"runtime_mappings\": {\r\n \"rx_bytes_per_period\":
{\r\n \"type\": \"long\",\r\n \"script\": {\r\n \"source\": \"\"\"\r\n
emit(doc['host.network.ingress.bytes'].size()==0 ? -1 :
(doc['host.network.ingress.bytes'].value/doc['metricset.period'].value));\r\n
\"\"\"\r\n }\r\n }\r\n }\r\n```\r\n\r\n2.
Using\r\n[Scripted_Metric](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-scripted-metric-aggregation.html):\r\n\r\n```\r\nscripted_metric\":
{\r\n \"init_script\": \"state.bytes_per_period = []\",\r\n
\"map_script\":
\"state.bytes_per_period.add(doc['host.network.ingress.bytes'].value/(doc['metricset.period'].value/1000))\",\r\n
\"combine_script\": \"double avg_bytes_per_period = 0; for (t in
state.bytes_per_period) { avg_bytes_per_period += t } return
avg_bytes_per_period/state.bytes_per_period.size()\",\r\n
\"reduce_script\": \"double result = 0; for (a in states) { result += a)
} return result/states.size()\"\r\n }\r\n```\r\n\r\n##
Conclusion\r\n\r\nI decided to go with the runtime field as its a bit
more concise and\r\neasier to understand and performance wise it was
slightly faster than\r\nthe scripted metric in most times.\r\n\r\n###
Testing\r\n\r\nNavigate to `Observability` -> `Overview` -> `Hosts
Table` try to filter\r\nwith Rx and Tx
columns","sha":"6e4f22d12dfc18ceff35b9bd0f6038b7fbf5ec7b"}}]}]
BACKPORT-->

Co-authored-by: mohamedhamed-ahmed <eng_mohamedhamed@hotmail.com>
2022-11-29 03:47:22 -07:00
Kibana Machine
8d29d1d65a
[8.6] [Infrastructure UI] Navigate to node detail page without refresh (#145742) (#145841)
# Backport

This will backport the following commits from `main` to `8.6`:
- [[Infrastructure UI] Navigate to node detail page without refresh
(#145742)](https://github.com/elastic/kibana/pull/145742)

<!--- 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":"2022-11-21T11:19:31Z","message":"[Infrastructure
UI] Navigate to node detail page without refresh (#145742)\n\nCloses
[#110219](https://github.com/elastic/kibana/issues/110219)\r\n\r\n##
Summary\r\n\r\nThis change fixes the forced page refresh when opening
the node detail\r\nfrom the inventory page.\r\n\r\nThis happened due to
the property `href` rendering a native anchor tag\r\nwhich interpreted
the navigation to the detail view as a completely new\r\npage,
refreshing the whole Kibana view.\r\n\r\nSpreading the properties
returned by
the\r\n[useLinkProps](2b2843fc27/x-pack/plugins/observability/public/hooks/use_link_props.ts)\r\nassure
the button receives the `onClick` handler and properly navigate\r\nto
the detail without forcing a refresh.\r\n\r\n## Testing\r\n\r\nNavigate
to `Inventory`-> `Click any available node` -> `\"Open as page\"\r\non
top-right corner of the
popover`\r\n\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"12b010ce22f6221dfb43adfa83e7e49ecce89a55","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:all-open","v8.7.0"],"number":145742,"url":"https://github.com/elastic/kibana/pull/145742","mergeCommit":{"message":"[Infrastructure
UI] Navigate to node detail page without refresh (#145742)\n\nCloses
[#110219](https://github.com/elastic/kibana/issues/110219)\r\n\r\n##
Summary\r\n\r\nThis change fixes the forced page refresh when opening
the node detail\r\nfrom the inventory page.\r\n\r\nThis happened due to
the property `href` rendering a native anchor tag\r\nwhich interpreted
the navigation to the detail view as a completely new\r\npage,
refreshing the whole Kibana view.\r\n\r\nSpreading the properties
returned by
the\r\n[useLinkProps](2b2843fc27/x-pack/plugins/observability/public/hooks/use_link_props.ts)\r\nassure
the button receives the `onClick` handler and properly navigate\r\nto
the detail without forcing a refresh.\r\n\r\n## Testing\r\n\r\nNavigate
to `Inventory`-> `Click any available node` -> `\"Open as page\"\r\non
top-right corner of the
popover`\r\n\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"12b010ce22f6221dfb43adfa83e7e49ecce89a55"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145742","number":145742,"mergeCommit":{"message":"[Infrastructure
UI] Navigate to node detail page without refresh (#145742)\n\nCloses
[#110219](https://github.com/elastic/kibana/issues/110219)\r\n\r\n##
Summary\r\n\r\nThis change fixes the forced page refresh when opening
the node detail\r\nfrom the inventory page.\r\n\r\nThis happened due to
the property `href` rendering a native anchor tag\r\nwhich interpreted
the navigation to the detail view as a completely new\r\npage,
refreshing the whole Kibana view.\r\n\r\nSpreading the properties
returned by
the\r\n[useLinkProps](2b2843fc27/x-pack/plugins/observability/public/hooks/use_link_props.ts)\r\nassure
the button receives the `onClick` handler and properly navigate\r\nto
the detail without forcing a refresh.\r\n\r\n## Testing\r\n\r\nNavigate
to `Inventory`-> `Click any available node` -> `\"Open as page\"\r\non
top-right corner of the
popover`\r\n\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"12b010ce22f6221dfb43adfa83e7e49ecce89a55"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
2022-11-21 05:27:14 -07:00
jennypavlova
637499fd73
[Infrastructure UI] In Product Feedback - Kibana Feedback Link for Hosts page (#145139)
Closes #144451

## Summary

This PR adds "Technical Preview" badge and "Give Feedback" link to hosts
page. Additionally it adds also the link and tag to the advanced
settings

### Testing
Enable host view from `Stack Management` -> `Advanced Settings` (The
`[technical preview]` and the feedback link should be visible there):
<img width="1449" alt="image"
src="https://user-images.githubusercontent.com/14139027/201715747-9707ec5d-e5e9-4212-898e-08c3b9f1d243.png">
Open Hosts page - the feedback link and technical preview badge should
be visible:
<img width="1570" alt="image"
src="https://user-images.githubusercontent.com/14139027/201716710-fc917f16-b888-441b-8421-0a1953b4c696.png">
2022-11-14 20:50:27 +01:00
Chris Cowan
1cea0299ac
[Metrics UI] Use bucketSize from request options for overview query (#145032)
## Summary

This PR fixes #145030 by using the `options.bucketSize` in the
`date_histogram` for the Overview query.
2022-11-14 12:31:22 -07:00
jennypavlova
20e2fb5e1e
[Infrastructure UI] Add URL state to Hosts View (#144181)
Closes  [#141492](https://github.com/elastic/kibana/issues/141492)
## Summary
This PR adds `query`, `timeRange` and `filters` parameters to the URL
state on the hosts view. URL parameters are updated after search filters
are applied (after click on the "update" button.

## Testing
Different cases:
- Add new search criteria ( filter / time range / query ) and click on
"update" - the URL should update
- Save a query and reload
- Load a saved query 
- Change an existing query


![image](https://user-images.githubusercontent.com/14139027/199047590-29e375fb-6909-424b-89c4-ef9193a77b10.png)


![image](https://user-images.githubusercontent.com/14139027/199046342-29fbfa76-0314-462b-b593-2c535112be09.png)


![image](https://user-images.githubusercontent.com/14139027/199046201-76ace0fa-8d17-4e1f-b36f-54a2419fb6af.png)

- Open the URL in a new browser tab/window - the filters should be added

Co-authored-by: Carlos Crespo <carloshenrique.leonelcrespo@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
2022-11-14 19:50:07 +01:00
jennypavlova
00b5e88ef3
[infrastructure UI] Metrics should use inventory metric formatter (#145085)
Closes #144637

## Summary

This PR fixes the formatting issue on the host view page. To keep it
consistent with the inventory page the formatters used there are
extended and used on the Host View.
I kept the 'N/A' fallback for missing values similar to the APM tables
as I think it looks better in the table ( the inventory formatter will
return an empty string in that case but it is also used for the tooltips
and there maybe it makes sense to leave it empty)


### Testing

Open the Host View and check the formatting of the values of the table: 
<img width="2440" alt="image"
src="https://user-images.githubusercontent.com/14139027/201635976-ea2d5a65-b678-4484-a8f5-d6ee07278eb7.png">
2022-11-14 18:33:29 +01:00
Bena Kansara
c520da99ee
Adds additional context to recovered alerts of Infrastructure rules (#144683)
## Summary

Closes https://github.com/elastic/kibana/issues/143725,
https://github.com/elastic/kibana/issues/143726

This PR reads the context variables indexed in Alerts-As-Data for
`Infrastructure Rules` and adds it to context when alerts are recovered.

Also, the context variables are now flattened before being indexed in
AAD for both of the `Infrastructure Rules`.

## The context newly added for recovered alerts with this PR
- `cloud.*`
- `host.*`
   - Excluding:
      - `host.cpu.*`
      - `host.disk.*`
      - `host.network.*`
- `orchestrator.*`
- `container.*`
- `labels.*`
- `tags`

### Checklist

- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-10 19:26:02 +01:00
Bena Kansara
74a2b37631
Adds list of containers in context variable of Inventory rule (#144526)
## Summary

Closes https://github.com/elastic/kibana/issues/143727

When Inventory rule is created for `Kubernetes Pods` as node type, the
`context.container` will contain an array of containers. For other node
types, the `context.container` will contain single container
information. This is to cover the use case where Kubernetes pod has more
than one container.

## Manual testing

### 1. Create rule for `Kubernetes Pods`
- Create Inventory rule for `Kubernetes Pods`
- Select a connector to schedule action
- Add `{{context}}` in the action template
- Wait for alerts to be generated
- Observe `context.container` lists all containers

<img width="803" alt="Screenshot 2022-11-04 at 10 55 19"
src="https://user-images.githubusercontent.com/69037875/199945124-08590d1e-50ed-4b41-a256-8b16548dbdbd.png">

### 2. Create rule for `Hosts`
- Create Inventory rule for `Hosts`
- Select a connector to schedule action
- Add `{{context}}` in the action template
- Wait for alerts to be generated
- Observe `context.container` contains single container

<img width="520" alt="Screenshot 2022-11-04 at 10 59 31"
src="https://user-images.githubusercontent.com/69037875/199945890-a38a695a-61bc-49cb-9eb4-6fa806f4bdc9.png">

### Checklist
- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-10 19:24:03 +01:00
Felix Stürmer
c88a680c60
[Logs UI] Use the Unified Search Bar for date range selection (#144351)
This enables the date-picker of the unified search bar introduced into the Logs UI in #143222 and simultaneously removes the custom date picker.

closes https://github.com/elastic/kibana/issues/142767
2022-11-09 18:49:32 +01:00
Dmitry Tomashevich
a9162f7481
[Discover] Enable esQuery alert for adhoc data views (#140885)
## Summary

Closes #142514 #142389

This PR does the following: 
- Enables to create `esQuery` (in KQL or Lucene mode) using adhoc data
views from discover and management pages
- Adds `explore matching indices` button to data view picker in alert
flyout
- Adding adhoc data views from alert flyout should propage them to a
main discover picker


### 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)
- [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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))

Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
2022-11-09 18:55:34 +03:00
Carlos Crespo
c9f0f3e3d4
[Infrastructure UI] Add disk latency metrics to hosts table (#144312)
## Summary

Closes #141982.

This PR adds disk latency metric to the Hosts table


### Screenshots

Windows
<img width="1464" alt="image"
src="https://user-images.githubusercontent.com/2767137/199536550-ab9123ae-3ed3-4d7b-be1c-f3e4a8cf911c.png">

MacOS and Linux
<img width="1443" alt="image"
src="https://user-images.githubusercontent.com/2767137/199536934-364aa288-680b-4f72-8b9c-83350740e5b8.png">


### How to tests

- Start a local ES instance
- Start a local metricbeat with system module enabled and `diskio` on
the metricset list
- Enable Infrastructure Hosts view in Advanced Settings
- Go to Infrastructure > Hosts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-09 10:44:37 +01:00
Bena Kansara
dffa38427a
Adds new contextual attributes to Infrastructure - Metric threshold rule (#143001)
* creating alert link with alert id and rule id

* Revert "creating alert link with alert id and rule id"

This reverts commit 29bede6aab.

* additional context variables for metric threshold rule

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fixing type error

* changed description of context variables

* adding context only if group by is available, creating container list

* refactoring, fixing types

* fixing CI error

* fixed issues

* refactoring

* fixing failing tests

* refactoring, fixing tests

* added tests, refactoring

* fixing issue with group by

* fixing failing tests

* fixing failing tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fixing failing tests

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* refactoring

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-08 13:56:57 +01:00
Bree Hall
4e9f1c0d04
Bumping EUI to version 67.1.8 (#141279)
* Updated EUI to version 67.1.2. Updated instaces of ButtonColor from EUI to EuiButtonColor.

* Updated to EuiCard instances that utilize the betaBadgeProps object to return an empty string instead of undefined when the label is unavailable

* Removed two instances of the deprecated internetExplorerOnly() mixin

* Updated two instances of the ButtonColor import to EuiButtonColor as is was renamed in PR #6150

* Updated snapshots in Jest Test Suite #1 to account for EuiButton and EuiCard Emotion conversions. Updated snapshots for EuiTooltip as it now contains the new EuiToolTipAnchor component that replaced the tooltip anchor styles

* Updated snapshots in Jest Test Suite #2 to account forEuiButton, EuiDescriptionList, EuiButtonIcon, and EuiBadge Emotion conversions.

* Updated snapshots in Jest Test Suite #3 to account for EuiDescriptionList, EuiButton, and EuiBadge Emotion conversions. Updated snapshots for EuiTooltip as if now contains the new EuiTooltipAnchor component that replaced the tooltop anchor styles

* Updated snapshots in Jest Test Suite #4 to account for EuiButton Emotion conversion.

* Updated snapshots in Jest Test Suite #5 to account for EuiButton Emotion conversion.

* Updated snapshots in Jest Test Suite #8 to account for EuiButtonIcon and EuiButton Emotion conversions. Updated snapshots for EuiTooltip as it now contains the new EuiTooltipAnchor component that replaced the tooltip anchor styles.

* Updated snapshots in Jest Test Suite #9 to account for EuiFlyout and EuiButton Emotion conversions.

* Updated snapshots in Jest Test Suite #10 to account for EuiButton, EuiBadge, EuiButtonIcon, and EuiCard Emotion conversions. Updated snapshots for EuiToolTtip as it now contains the new EuiTooltipAnchor component that replaced the tooltip anchor styles

* Updated instances of EuiButtonIconColor to use EuiButtonIconProps['color'] as it was removed in PR #6150

* Updated tests that target EuiButton to simulate click events to target a generic button to prevent undefined click event errors

* Updated snapshots in Jest Test Suite #1 to account for EuiButton and EuiCard Emotion conversions

* Added the EuiFlyout mixins and variables to Lens Sass file as EuiFlyout has been converted to Emotion and the Sass styles are no longer available in EUI

* Added the EuiCallOutTypes variable to Step Progress Sass file as EuiCallOut has been converted to Emotion and the Sass styles are no longer available in EUI

* Updated snapshots in Jest Test Suite #2 to account for recent Emotion conversions.
Updated snapshots in server_status.test.tsx to render EuiBadge before checking the snapshots to reduce the snapshot churn caused by Emotion.
Updated tests that target EuiButton to simulate click events to target a generic button to prevent undefined click event errors

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Added imports for the added flyout mixin. Removed references to EuiCallOut mixin as the component has been converted to Emotion and is no longer available for use.

* Updated unit tests and snapshots in Jest Test Suite #10.
Updated snaphshots to account for EuiBadge, EuiDescriptionList, EuiFlyout, and EuiCard Emotion conversions. Updated snapshots for EuiTooltip as it now contains the new EuiTooltipAnchor component that replaced the tooltip anchor styles.
Updated tests that target EuiButton to simulate click events to target a generic button element to prevent undefined click event errors

* Updated unit tests in Jest Test Suite #11 that target EuiButton to simulate click events to target a generic button to prevent undefined click event errors

* Updated unit tests in Jest Test Suite #12 by updating tests that target EuiButton to simulate click events. Instead, these tests now target a generic button element to prevent undefined click event errors

* Updated unit tests in Jest Test Suite #1 by updating tests that target EuiButton to simulate click events. Instead, these tests now target a generic button element to prevent undefined click event errors

* Updated unit tests in Jest Test Suite #2 by updating tests that use EuiButton to simulate click events. Instead, these test have been updated to target a button element to prevent undefined click event errors.

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Updated reference to mixins Sass file.
Updated snapshots for Jest Test Suite #5 to account for EuiButton Emotion conversion. Updated unit tests that target EuiButton to simulate click events. These tests have been updated to target a button element to prevent undefined click event errors

* Updated unit tests in Jest Test Suites 3, 7, 8, 13, and 14.
Updated snapshot to account for EuiButton Emotion conversion.
Updated tests that target EuiButton to simulate click events. These tests now target a generic button element to prevent undefined click event errors.
Updated a few snapshots by adding .render() before checking the snapshot. This will prevent large snapshots coming from recent Emotion conversions

* Updated snapshots in Jest Test Suite #10 to account for the recent EuiButton Emotion conversion

* Updated unit tests in Jest Test Suite #2 by editing tests that target EuiButton to simulate click events. These tests now target a button element in order to prevent undefinde click event errors

* Updated snapshots in Jest Test Suite #10 to account for EuiButton and EuiDescriptionList Emotion conversions

* Updated test cases in Jest Test Suites 3, 7, and 8. Updated snapshots to account for EuiButton and EuiPagination Emotion conversions.
Updated tests that target EuiButton to simulate click events. These tests now target a button element to prevent undefined click errors

* Updated test cases in Jest Test Suite 14. Updated snapshots to account for EuiButton Emotion conversion. Opted to use .render() when updating a few snapshots to reduce the large length of snapshots caused by Emotion

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Revised a change to betaBadgeProps to ensure that the label is available. If not, the value for the badge with be set to undefined.

* Resolved two linting errors

* Resolved two linting errors

* Updated Jest unit tests in various suites.
Updated snapshots to account for EuiButton Emotion conversion. Updated snapshots for EuiTooltip as it now contains the new EuiTooltipAnchor component that replaced the tooltip anchor styles.

* Updated EuiFlyout in query_flyout.tsx to remove the onClick function from maskProps as it is no longer available. Updated this flyout to use ownFocus and not to close when the overlay mask is clicked.

* Removed the use of EuiButtonIconColor in favor of EuiButtonIconProps['color']

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Updated Cypress test looking for strict equality on EuiPaginationButton class names to match a substring of the Emotion generated class name

* Removed unneeded debugging code. Updated snapshots for various test suites to account for the recent EuiButton Emotion conversion

* Updated a few EuiButton, EuiButtonEmpty, and EuiText components that set the color as ghost. The ghost color mode has been deprecated as of PR #6150. These components now are wrapped in EuiThemeProvider with a dark colorMode to create the previous ghost color.

* Resolved  TS error with EuiCard betaBadgeProps

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Remove references to now-removed EuiFlyout CSS classes/vars

* Remove now-removed euiBadge className references

- Convert directly to EuiBadge instead of using CSS

- Remove confusing and now-possibly-irrelevant CSS badge overrides - left/right icons are now set via JSX and not via flex-direction

* Pre-emptively fix various euiOverlayMask CSS overrides

- this data attr isn't technically in yet but will be once https://github.com/elastic/eui/pull/6289 merges

- at the very least this isn't breaking any more than it currently already is!

* Update to v67.1.3

* v67.1.4

* Resolved test failing test case in Security/Manage/Blocklist. The test did not remove focus from the last combo box in the form, which didn't allow the disbaled attribute to be removed from the flyout submit button. I've updated the mock file for Blocklist to return focus to the first form element in the flyout to allow the disabled attribute to be removed.

* Updated snapshots to account for the recent EuiText Emotion conversion

* Fix Log's custom tooltips relying on EuiTooltip classNames that no longer exist

* Fix Vega vis custom tooltips relying on EuiTooltip classNames that no longer exist

- this one is trickier than Log's as it's not using React, so we need to use Emotion's Global to set a static className

* Convert remaining vega_vis.scss to Emotion

- as an example of how other global + non global styles could be handled in the future

* Fix references to removed `euiPaginationButton-isActive` className

- use aria-current attribute instead

* Added missing EuiFlyoutAnimation keyframes for EuiFlyout. This resolved test that failed because they used onAnimationEnd because the FlyoutAnimation could not be found.

* Reolved Jest Tests in suites 1 and 5. Updated snapshots to account for the recent EuiButton Emotion conversion. Updated snapshots for EuiToolTip as it now contains the new EuiToolTipAnchor component that replaced the tooltip anchor styles.

* iterate on rules_list.test.tsx

* bump eui to v67.1.5

* Updatde snapshots for jest test suites to account for the recent EuiButton, EuiOverlayMask, EuiTooltip, and EuiBadge Emotion conversions

* Resolved failing security test by updating the target element for CONNECTOR_TITLE. EuiCard has recently been converted to Emotion and the card title is no longer wrapper in a span.

* Resolved failing test case in Runtime Fields. The modify runtime field test was failing because the combobox responsbible for adding and updating scripts was not appearing. The textbox did not appear because the shared setFieldScript function targets and toggles the script textbox when opening the flyout. When a runtime field is being modified, the toggle is already active and using the shared function will trigger the toggle again (losing access to the script textbox).
Also resolved an issue that prevented the warning EuiCallout to appear when changing the type of a runtime field from its original type. Resolved this by adding an enter keypress at the end of setFieldType function to confirm the type selection, thus triggering the EuiCallout

* Resolved two tests that were failing in Lens. These test were failing because they were checking for equality in class names that no longer exist within EuiButtonGroup as it was recently converted to Emotion. These tests were updated to check for a substring of the new and longer class name

* Quick fix in test case failing because of misspelling in data-test-sub

* Updated snapshot for Jest test case as EuiButton as recently been converted to Emotion

* Removed console.log statement. Oops!

* Resolved a failing test case in Lens. They were failing because they were checking for equality in class names that no longer exist within EuiButtonGroup as it was recently converted to Emotion. These tests were updated to check for a substring of the new and longer class name.
Updated a Security test case by giving a target button the data-test-subj attribute for easier querying

* Removed reference to EuiFlyout mixin as it has been converted to Emotion. Updated the reference to an interal copy of EuiFlyout styles

* Corrected spelling error in EuiFlyout animation in Lens app

* Update EUI with latest backport

* Update button snapshots

* fix another button snapshot

* More snapshot fixes

* [EuiButton][Security] Fix button relying on now-removed `euiButton__text` CSS

- replace removed CSS with `eui-textTruncate` util instead

- combine/DRY out unnecessary span - was affecting min-width of truncation util

+ increase screenshot diff limit - this was smaller than updating the actual baseline screenshots for whatever reason (likely render diff between local and CI)

* Fix remaining Jest tests affected by Emotion conversions

- because Emotion creates its own wrapper, `.first()` can no longer be used - prefer `.last()` instead

* Fix Jest test affected by EuiButton Emotion conversion + removed modifier class

- targeting the native DOM node + filtering by disabled true/false gets us back to the 'correct' lengths

* Fix + improve flyout test

- `.last()` changes to account for EuiButton Emotion conversion is needed, but the last onClose assertion still fails due to us having modified inputs, and the confirm modal being displayed

- split test into two separate tests - one testing the onClose call, and the other testing the confirm modal

* derpin

* Skip rules_list Jest suite

* Update new EuiButton snapshot

* Upgraded EUI version to 67.1.7

* [EuiCard] Update snapshots

* [EuiPopover] Update snapshots

* [QA] Fix missing Vega warn/error message colors

;_;

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* Fix Lens kbnToolbarButton regressions

- Caused by flattening of EUI button CSS specificity

- background-color was previously relying on isDisabled CSS specificity to override its #fff color

- `text` color modifier & `!important` is no longer needed and overrides Emotion CSS flatly

- isDisabled class is no longer needed - euiButton no longer sets `pointer-events: none` on disabled buttons (fixes tooltip bug in webkit as well)

* Backport EUI 67.1.8 fixes

* Update EuiCard snapshots

* Fix EuiModal form wrapper causing overflow issues

- see https://elastic.github.io/eui/#/layout/modal#forms-in-a-modal

* Workaround for `.kbnOverlayMountWrapper` mount point causing overflow issues

- not sure what all is using this modal service to be honest, but the wrapper is causing issues with the modal layout, this fixes overflow issues but will not fix any mask-image issues as a result

* more snapshot updates

* EuiButton - added textProps to EuiButton to prevent very long button names from spilling over outside of the container

* EuiButton - Update EuiButton related snapshots. Updated tests that target EuiButton directly to use a data-telementary-id for more specific element querying required by Emotion

* QA - Removed unnecessary comment in code

* Temporary fix for EuiCard[selectable][layout=horizontal] instances on security solutions' rule page

* Temporary fix for EuiCard[selectable][layout=horizontal] instances on osquery live query and canvas's datasource selector

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Fix CSS specificity, where canvas's solutionToolbarButton's background-color now takes precedence over EuiButton's primary styles

* Removed update to search_marker_tooltip that removed the euiTooltip styles and replaced then with Emotion styling. Added EuiTooltip Sass styles for the component to rely on to test for a styling bug that is causing the tooltip and the tooltip arrow to be out of sync with each other.

* Lint Sass file

* Lint Sass file

* Removed overflow:hidden style from .vgaVis_view as it was causing euiScrollStyles not to present the scroll bars in Vega Vis

* Remove typo from EuiButton textProps object. 'className' should not have been included in the actual class name

* Revert tooltip Sass

This reverts commit 20e6ead571, a5cd2de901, and c605cbd7b9

* Fix Emotion tooltip arrows

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Chandler Prall <chandler.prall@elastic.co>
2022-11-07 21:45:50 +00:00
Coen Warmer
8d5ba8706f
[Actionable Observability] Add context.alertDetailsUrl to connector template for Logs threshold rule (#144623) 2022-11-07 10:25:25 -07:00
Ying Mao
5bc408fc89
[Response Ops][Rule Registry] Add data provider to retrieve new, ongoing and recovered alerts from alerts-as-data (#143466)
* Register rule data client with alerting

* wip

* get summarized alerts

* cleanup

* Adding queries

* Adding unit tests

* Adding condition to queries in order to limit number of alerts returned

* Fixing runtime mapping script

* Removing runtime mappings

* Adding function to persistence and lifecycle wrappers

* Adding functional test

* Updating README

* Adding comments

* lte to lt

* Revert "lte to lt"

This reverts commit bbc2604a00.

* lte to lt

* Fixing test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-07 08:19:02 -05:00
Ying Mao
3b59a90671
[Response Ops][Alerting] Removing top level rule fields passed into executors (#144270)
* Removing top level fields passed into executors

* Updating stack rules

* Updating other rules

* Fixing types

* Fixing functional test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-04 09:20:54 -04:00
Kerry Gallagher
056413e8b4
[Logs UI] Support the Unified Search Bar for Query input (#143222)
* Use Unified Search Bar for query input
2022-11-02 09:58:29 +00:00
Chris Cowan
5286358b28
[Actionable Observability] Verify missing groups for Metric Threshold rule before scheduling no-data actions (#144205) 2022-11-01 14:21:26 -04:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Carlos Crespo
eff4ce0cd5
[Infrastructure UI] Add unified search to hosts table (#143850)
* Add unified search to hosts table

* Add saved query support

* Adjust error handling

* Minor refactoring and unit tests

* Revert changes to translations

* CR fixes
2022-10-27 15:56:54 +02:00
Coen Warmer
7bc63e07af
Add context.alertDetailsUrl to connector template when configuring a Rule (#142854) 2022-10-27 15:20:43 +02:00
jennypavlova
2de4f152d0
[Infrastructure UI] Hosts table sorting and pagination (#143834)
* remove lens, add snapshot api

* add no data

* Add cpu type

* [WIP] Add eui basic table and columns

* [WIP] Add cpu cores and os

* [WIP] Mapping data to the eui basic table format

* Add Memory Total

* Refactor host mapping and add types

* Scale up memory usage percentage

* Make os optional in the model

* Text cells formatting

* Change os.type to os.name

* Move snapshot nodes mapping to a hook and test it

* Add translation

* Add fixed range and cleanup

* Fix diskLatency field name

* Remove not existing showQueryBar prop from SearchBar and set time range values

* Use last path

* Test last path change

* Type imports

* Change the way lastPath.os is set

* Type import

* Sorting columns

* Use EuiInMemoryTable pagination and sorting and change mapping

* Set sorting to true and remove the default cpuCores field  sorting option

* Update types

* Add mapping for the metric values used in hosts table

* Shorthand props

* Os from path - replace lodash and remove not needed null handling

* Fix types

* Remove type export

* Change metrics mapping

Co-authored-by: neptunian <sandra.gonzales@elastic.co>
2022-10-26 14:50:35 +02:00
Sandra G
ffc8fb90fd
[Infrastructure UI] Replace Lens table with EUI table and own api (#142871)
* remove lens, add snapshot api

* add no data

* Add cpu type

* [WIP] Add eui basic table and columns

* [WIP] Add cpu cores and os

* [WIP] Mapping data to the eui basic table format

* Add Memory Total

* Refactor host mapping and add types

* Scale up memory usage percentage

* Make os optional in the model

* Text cells formatting

* Change os.type to os.name

* Move snapshot nodes mapping to a hook and test it

* Add translation

* Add fixed range and cleanup

* Fix diskLatency field name

* Remove not existing showQueryBar prop from SearchBar and set time range values

* Use last path

* Test last path change

* Type imports

* Change the way lastPath.os is set

* Type import

Co-authored-by: Jenny <dzheni.pavlova@elastic.co>
2022-10-24 10:38:25 +02:00
Matthew Kime
631c24abf4
[unified search] Query string input uses data views plugin directly instead of via deprecated data plugin reference (#143611)
* use data views plugin

* remove unneeded dependency

* use data views plugin

* fix type

* type fix

* supply dataViews as depedency

* supply dataViews as depeden
2022-10-20 07:15:33 -07:00
Pierre Gayvallet
e9ae5700af
Bump elastic/elasticsearch to 8.4.0-canary.1 (#142816)
* Bump `elastic/elasticsearch` to `8.4.0-canary.1`

* fixing package violations

* some xpack violations

* remove more unused ts-expect-error

* started muting errors

* start adapting watcher

* fix more usages

* fix more usages

* fixing more usages

* just one more

* more usages

* infra usages

* moar types

* fix unit test

* adapt more usages

* fixes in FTR tests

* try to fix kbn/es-types

* last fixes?
2022-10-19 02:37:51 -07:00
Stratoula Kalafateli
411a306216
[Unified search] Cleanups the showQueryBar flag (#143270)
* [Unified search] Cleanups the showQueryBar flag that is not used anymore

* Fix add filter story error
2022-10-18 11:24:17 +03:00
doakalexi
b00f3b0ab9
[ResponseOps][Alerting] create new logger with tag for rule/connector type, for logger given to executors (#142121)
* Updating connector logger

* Updating rule logger

* Fixing type failure

* Fixing failing tests

* Fixing other type failure

* Fixing types

* Fixing more types

* Making logger optional

* Removing change

* Fixing errors

* Fixing preview routes

* Fixing tests and types

* Updating substrings

* Use logger in runRule function

* Fixing task runner tests

* Updating logger in constructor

* Linting fix

* Fixing action logger
2022-10-17 15:33:06 -04:00
Bena Kansara
4f3558a89c
Adds new contextual attributes to Infrastructure - Inventory Rule (#140598)
* adding context for nodetype Hosts for Inventory rule

* removing unused import

* adding more action variables, fixing failing tests

* minor changes

* refactoring

* removing extra fields being added with context

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fixing failing tests

* refactoring

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* adding component template ref

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* changed description

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-12 17:41:15 -06:00
Felix Stürmer
6792b7c9c6
[Logs UI] Respect and report on log threshold alert limits (#142263)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-12 12:27:58 +02:00
Stratoula Kalafateli
8c4976f25d
[Lens] Rename datasources (#142553)
* Rename to textBased instead of textBasedLanguages

* [Lens] Rename datasources to textBased and formBased

* Fix css

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Move datasources under a common foler

* Fix types

* Revert css classes

* Add migration script

* Fix lens embeddable functional tests

* Fix types

* Fixes cases test

* Adds migration script test

* Revert

* Update jest integration test

* Fix security solution tests

* Fix jest test

* Address type nit

* Fix types

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-12 11:25:24 +03:00
jennypavlova
d95e690e9e
[Infrastructure UI] Use same no data messaging on hosts view (#142063)
* [WIP] Implement No Data message

* Implement refetch

* Render lens component and hide when there is no data

* Add onLoading hook and conditional rendering

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-04 16:37:19 +02:00
Milton Hultgren
d60acf8774
[Infra] Make nav react to Hosts view enabled flag changing (#142477)
* [Infra] Make nav react to Hosts view enabled flag changing (#140996)

* Move comment to more relevant location

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-04 04:11:11 -07:00
Sandra G
40b397d0e1
add rx and tx to lens table (#142137)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-03 10:24:25 -04:00
Carlos Crespo
60e5e41107
Fix Legend Options and Node Map layout on mobile view (#142052)
* Fix Legend Options and Node Map layout on mobile view

* Fix Number of Color bar on mobile

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-29 14:23:50 +02:00
jennypavlova
82492c791a
[Infra Monitoring UI] Change infrastructure pages titles to use breadcrumbs #135874 (#140824)
* Use breadcrumbs to set page title intead of DocumentTitle

* Remove document title component and use breadcrumbs - Logs Page

* Remove no longer needed document title translations

* Use docTitle.change in error page and remove document title component

* Add document title check to the functional tests

* Move test to check title after load

* test: Title change

* Remove unnecessary docTitle type

* Add error page tests

* Update snapshot

* Functional tests: Wait for loading the header before checking the title

* Change test to use react testing library

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-28 13:45:14 +02:00
Sandra G
e24ca7a89b
change from host.os.name to host.os.type (#141432)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-27 09:55:44 -04:00
Chris Cowan
08e9c63659
[Actionable Observability][Metric Threshold Rule] Add histogram support to avg, max, min, sum and percentiles (#139770) 2022-09-21 19:02:00 -06:00
Nodir Latipov
10211c6df7
[Unified Search] Fix regress autocomplete (#140880)
* fix: refress with autocomplete

* fix: autocomplite

* feat: added usageCollection to unified search plugin

* fix: check type

* fix: jest test

* refact: move usageCollection to optionalPlugins

* cleanup

* fix: avtocomplete in lens

* fix default editro

* some cleanup

* feat: rename app name in Lens

* feat: rename app in apm

* fix: descover autocomplete
2022-09-21 16:29:46 +05:00
Trevor Pierce
378829348c
Bumping EUI to version 64.0.4 (#140323)
* Bumping EUI to version 64.0.1.

* Updating snapshot tests for two directories.

* Deprecate basic usages of getBreakpoint

- in favor of useCurrentEuiBreakpoint

* [Fleet] Deprecate isWithinMaxBreakpoint

- in favor of hook

* [DataViz] Update DataVisualizerTable to use window breakpoint vs table resize observer

- since getBreakpoint is now deprecated, we're only looking at the current EUI breakpoint (based off window width)

* [KibanaThemeProvider] Allow apps to modify the default EUI theme

- Setup for custom xl+ breakpoint sizes used by APM and Synthetics

* [APM] Update useBreakpoints hook with EUI breakpoint deprecations

- since getBreakpoint is no longer an usable util

- EUI's new breakpoint hooks already use/debounce window resize events, so we now get to skip all that custom logic by simply making custom EUI breakpoint overrides and using EUI breakpoint hooks

- remove returned `breakpoint` and `width` keys - they weren't actually being used anywhere in APM that I could see and were causing type errors.
- If someone wants to access them, they can use `useCurrentEuiBreakpoint` and `useWindowSize` individually instead

* [UX] Update useBreakpoints hook copied from APM

- basically the exact same logic, they just also need the xxl and xxxl breakpoints

* [Synthetics] Remove `useBreakpoints` in favor of new EUI breakpoint hooks

+ add xxl and xxxl breakpoints to Synthetics EUI themes

- `useBreakpoints`: - as far as I can tell, all attached APIs are basically the same APIs that EUI provides OOTB:
  - up -> `useIsWithinMinBreakpoint`
  - down -> `useIsWithinMaxBreakpoint`
  - between -> `useIsWithinBreakpoints`
  - debouncedWidth - not used, but could just use `useWindowSize` directly instead

- note: i'm confused by the `xl` override/conflation with `xxl`, but left the default xl breakpoint size as-is and assumed that all usage instances of 'xl' actually wanted 'xxl'

* v64.0.2 - add missing backports and several new fixes

* v64.0.3

* Fix type error from breakpoint deprecation

- functionally doesn't matter since the array doesn't include undefined, so basically just silence TS complaining about it

* Updating additional snapshots after bump to EUI 64.0.3

* Adding RUM Jest snapshot update.

* Adding Timeout to Fleet token generation test.

* Revert "[DataViz] Update DataVisualizerTable to use window breakpoint vs table resize observer"

This reverts commit 4e60ce281d.

* [DataViz] Remove getBreakpoint usage

- by replacing the breakpoint logic/switch with custom breakpoint sizes and names

- since the table size can be within panels that don't match `window.innerWidth`, we can't use EUI's breakpoint utils here

* Restoring a needed hook for breakpoints.

* Fix broken side navs on uptime/apm/ux/synthetics

- because of their new custom xxl/xxxl breakpoints, the `isLargerBreakpoint` logic was broken on the shared solution nav. switching to a min breakpoint bound fixes the issue and futureproofs the solution nav for all apps that add larger breakpoints than xl

* Fix snapshots/unit tests from previous commits

* Bumping EUI to 64.0.4 backport.

* [PR feedback] Separate DataVisualizerTable more clearly from EUI breakpoints

- per discussion with Quynh and Walter, there's some confusion around the breakpoints that the table is using. Since the table is width is not always the width of the browser window, it cannot use EUI's breakpoint hooks, and should instead use its own custom map of table-specific breakpoints to make that separation clearer

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-09-20 08:50:15 -05:00
jennypavlova
33c6f4b01d
Fix missing padding from the page header to the main content (#140706)
* Move styles to the index.scss file to avoid emotion css override

* Use emotion css instead of scss
2022-09-20 13:14:12 +02:00
Pierre Gayvallet
9579ea7235
Move src/core/types/elasticsearch to @kbn/es-types (#140522)
* create empty package

* move types to packages

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* start fixing imports

* fix more imports

* fix inline import

* add apm-ui as owners

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* fix new usages

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-20 10:32:13 +02:00
Sandra G
93bfec9799
[Infra Monitoring UI] add tech preview for hosts view (#140766)
* add tech preview for hosts view

* update name

* add to oss_plugins
2022-09-19 15:05:23 -04:00
spalger
77964bc0f7 modernize test-subj-selector (#140847) 2022-09-15 22:08:51 -07:00
Constance
98f73d674a
Upgrade EUI to v63.0.6 - updates to new EuiPageTemplate and deprecates old page components (#139524)
* Update all usages of EuiPageTemplate to EuiPageTemplate_Deprecated

* EuiPageContent_Deprecated as EuiPageContent

* EuiPageContentBody_Deprecated as EuiPageContentBody

* EuiPageContentHeader_Deprecated as EuiPageContentHeader

* EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection

* EuiPageSideBar_Deprecated as EuiPageSideBar

* EuiPageContent__Deprecated to EuiPageContent_Deprecated

* Fix rogue semi-colons

* WIP: NoDataConfigPage & NoDataPage converted to new template

- `withSolutionNav` not yet handled

* WIP: KibanaPageTemplateInner converted to use new template

- Pushes existing `pageHeader` prompts onto created EuiPageTemplate.PageHeader
- Uses `isEmptyState` to push `pageHeader` props to EuiPageTemplate.EmptyPrompt instead (if `children` are not supplied)

* WIP: `withSolutionNav` now renders the sidebar content properly

- Collapsing isn’t working (minWidth isn’t updating)

* Fixing stickiness of sidebar

* [Security] Fixed SecuritySolutionTemplateWrapper’s usage

- Moved `bottomBar` to EuiPageTemplate.BottomBar (now contained in just the page contents)
- Change EuiPanel children wrapper with EuiPageTemplate.Section

* [O11y] Wrap `children` with EuiPageTemplate.Section

* Fix getting_started usage

* WIP: Fixing types

* Removing `template` pass through

* Set EUI to 63.0.0

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* More import fixes

* Sidebar component update

* Expand `KibanaPageTemplate` to all namespaced EUI counterparts

- Updated `docs/tutorials` mdx page
- Fixed SolutionNav prop types

* Updated the tutorial mdx page

* [Stack Management] Updated app layout to new template

- Some temporary props applied for BWC until all other pages can be converted
- Converted `API Keys` page’s layout (and especially prompt usags) to new paradigm

* Fix circular dep

* Fix new circular dependency

- copying and pasting types from KibanaPageTemplateProps, but ah well

* [Security Solution] Remove `template` prop - no longer a prop on Kibana/EuiPageTemplate

* [O11y] Allow customizing EuiPageTemplate.Section wrapper

- converts pageBodyProps
- fixes non-centered loading template

* [Enterprise Search] Update page templates

- fix layouts by auto-wrapping an EuiPageSection for padding, while adding a `customPageSections` prop for more custom sections/layouts

- re-center 404 errors

- update tests

* Update KibanaPageTemplate tests

* Update snapshots

* Fix FTR test with removed EUI classNames

* Fix FTR tests with changed kbn classNames

* Update failing dashboard snapshots

- drop shadow changed slightly in EUI

* Fix failing Security Cypress test

* [O11y] Fix Inventory page using deprecated CSS hooks

* [O11y][Uptime] Fix missing bottom bars

- Modifies ObservabilityPageTemplate to accept a `bottomBar` prop (a la the old EuiPageTemplate behavior)

NOTE: This opinionated page layout structure is starting to feel like it could be potentially limiting / have all the same pitfalls the previous EuiPageTemplate did. If so, consider something closer to the Enterprise Search page template conversion (`customPageSections`).

- Misc cleanup: Use `KibanaPageTemplate` over `EuiPageTemplate`

* [O11y] Fix route template typing

- Since theObservabilityPageTemplate is using the new Eui/KibanaPageTemplate, its child templates and types need to be updated accordingly

* Fix broken minWidth behavior

- was an EUI issue that required a patch release
+ update snapshots

* [Security Solution] Type fixes, restore empty state

- Fix empty state logic removed in a previous commit
- bogarts KibanaPageTemplate's `isEmptyState` prop instead of using `template="noData"`

- extend template wrappers to past ...rest to underlying Kibana/EuiPageTemplate

+ replace EuiPageTemplate with KibanaPageTemplate for consistency

* Fix failing synthetics selector

* Grab EUI v63.0.6

- for deprecation tags and section tag support

* Fix Kibana Overview plugin layout

- needs to use KibanaPageTemplate.Section to get padding back

- use `bottomBorder` prop over horizontal rules

- restore previous page color via panelled=false

* Convert Home plugin to new KibanaPageTemplate

- use KibanaPageTemplate.Section instead to preserve page width/paddings

- use `bottomBorder` instead of `EuiHorizontalRule`

- NOTE: This causes margins to decrease slightly from xxl to xl (largest padding available for EuiPageSection) - this can be restored by CSS overrides if desired

- update CSS to preserve previous looks, + convert to logical properties

* [O11y] Fix non-centered empty/loading states

* [O11y] Restore subdued background on various empty state prompts

* [O11y] Fix all instances of views that require a scrollable full-height child

+ restore comment for inventory view

* [O11y][ux] Fix broken sidebar

- The entire app was missing a wrapping EuiProvider, and as such breakpoint utils were not working, and the sidebar was missing

+ misc cleanup
  - remove unnecessary fragment
  - remove role="main" attr - now that EuiPageTemplate sets a `main` tag, they'll conflict
  - add isEmptyState to center loading component

* [APM Cypress tests] harden flaky test

* [APM Cypress tests] Fix failing Cypress test, again

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-07 15:35:23 -05:00
Felix Stürmer
5563b73677
[Metrics UI] Remove forbidden cross-boundary imports (#139757) 2022-09-05 23:44:44 -07:00
Pierre Gayvallet
383d8fab58
Move client-side application service to packages (#139502)
* deletes unused utils file

* just some fix while I see it

* creating empty packages

* moving all the things

* package build success

* start fixing usages

* fix the scoped history type issue

* export internal utils

* add default for mock

* fix test import

* fix external import

* start fixing external usages

* more usages

* more usages

* more usages

* More usages

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix integration test imports

* fix more test types

* remove public/utils from the core bundle

* trying to import from the package

* updating README's

* remove unused test types from mock package

* cleanup test types

* use import type

* add author to packages

* more import type

* remove dead path from some config

* remove src/core/utils/index.ts (and pray)

* update tsdoc

* fix new file usage

* fix paths

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-30 10:08:44 -07:00
jennypavlova
3cec0fc2fb
Fix typo in LegendControls (#139706) 2022-08-30 17:00:07 +02:00
Sandra G
7e1b60fa22
[Infrastructure UI] inital hosts page (#138173)
* inital empty hosts page and navigation item

* lens table and unified search

* add data view id

* cleanup

* clear searchs session when unmounting

* cleanup

* add some basic error handling for Data View

* change back loading text for now because of breaking test
2022-08-26 16:09:46 -04:00