Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Infrastructure UI] Improve metrics settings error handling #146272

Conversation

tonyghiani
Copy link
Contributor

@tonyghiani tonyghiani commented Nov 24, 2022

Closes #145238

Summary

These changes add validation to the Metric Indices passed into the Metrics settings page.
New validation is added both in the UI and in the endpoint, performing the following checks:

  • Index pattern is not an empty string
  • Index pattern does not contain empty spaces (start, middle, end) (the pattern is not trimmed)
  • Index pattern does not contain empty entries, comma-separated values should have an acceptable value.

In case the value is not valid, the UI will render an appropriate error message.
If the PATCH /api/metrics/source/{sourceId} request to update the value is manually sent with an invalid value, the server will respond with a 400 status code and an error message.

Also, for retro compatibility and to not block the user when the configuration can't be successfully retrieved, in case of internal error the GET /api/metrics/source/{sourceId} will return a 404 and on the UI, instead of rendering a blank page, the user will see the empty form and will be able to re-insert the right values.

Testing

Navigate to Inventory-> Click on Settings on the topbar -> Start writing different metric indices in the Metric Indices field.

Editing Metric Indices validation

edit-indices.mov

Missing/Broken configuration response

missing-configuration.mov

@tonyghiani tonyghiani requested a review from a team as a code owner November 24, 2022 10:38
@tonyghiani tonyghiani changed the title 145238 improve metrics settings error handling [Infrastructure UI] Improve metrics settings error handling Nov 24, 2022
@tonyghiani tonyghiani added Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Nov 24, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

Marco Antonio Ghiani added 2 commits November 24, 2022 13:04
// @ts-ignore
patchedSourceConfigurationProperties
));
? sources.updateSourceConfiguration(soClient, sourceId, sourceConfigurationPayload)
Copy link
Contributor

@crespocarlos crespocarlos Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing these ts-ignore annotations

body: metricsSourceConfigurationResponseRT.encode({ source: { ...source, status } }),
});
} catch (err) {
return response.notFound();
Copy link
Contributor

@crespocarlos crespocarlos Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering why we wouldn't just let the error propagate here? My concern is more whether this will mask an actual error - if it ever happens

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same concerns as you do, I'm actually looking at how behaves the client when receiving a 500 response to see if it breaks somewhere as it happens when the metricAlias is not valid.

Since it's not a real request error from the client, but it conflicts with the state of the data in the server, we could respond with a 409 when this is the case, what's your opinion about this?

@tonyghiani tonyghiani requested a review from a team as a code owner November 28, 2022 12:18
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1324 1325 +1
infra 1147 1159 +12
profiling 110 111 +1
ux 144 145 +1
total +15

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/io-ts-utils 20 22 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.1MB 3.1MB +141.0B
infra 1.1MB 1.1MB +2.4KB
profiling 238.2KB 238.3KB +143.0B
ux 163.1KB 163.2KB +144.0B
total +2.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/io-ts-utils 2 3 +1
Unknown metric groups

API count

id before after diff
@kbn/io-ts-utils 20 22 +2

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 443 449 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 520 526 +6
total +21

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@MiriamAparicio MiriamAparicio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌟

body: metricsSourceConfigurationResponseRT.encode({ source: { ...source, status } }),
});
} catch (error) {
return response.customError({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 !

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Cool io-ts tricks.

@tonyghiani tonyghiani merged commit ddcbf73 into elastic:main Nov 30, 2022
@tonyghiani tonyghiani deleted the 145238-improve-metrics-settings-error-handling branch November 30, 2022 10:54
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 30, 2022
…146272)

Closes [elastic#145238](elastic#145238)

## Summary

These changes add validation to the Metric Indices passed into the
Metrics settings page.
New validation is added both in the UI and in the endpoint, performing
the following checks:
- Index pattern is not an empty string
- Index pattern does not contain empty spaces (start, middle, end) (the
pattern is not trimmed)
- Index pattern does not contain empty entries, comma-separated values
should have an acceptable value.

In case the value is not valid, the UI will render an appropriate error
message.
If the `PATCH /api/metrics/source/{sourceId}` request to update the
value is manually sent with an invalid value, the server will respond
with a 400 status code and an error message.

Also, for retro compatibility and to not block the user when the
configuration can't be successfully retrieved, in case of internal error
the `GET /api/metrics/source/{sourceId}` will return a 404 and on the
UI, instead of rendering a blank page, the user will see the empty form
and will be able to re-insert the right values.

## Testing

Navigate to `Inventory`-> Click on `Settings` on the topbar -> Start
writing different metric indices in the Metric Indices field.

### Editing Metric Indices validation

https://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov

### Missing/Broken configuration response

https://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit ddcbf73)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 30, 2022
…146272)

Closes [elastic#145238](elastic#145238)

## Summary

These changes add validation to the Metric Indices passed into the
Metrics settings page.
New validation is added both in the UI and in the endpoint, performing
the following checks:
- Index pattern is not an empty string
- Index pattern does not contain empty spaces (start, middle, end) (the
pattern is not trimmed)
- Index pattern does not contain empty entries, comma-separated values
should have an acceptable value.

In case the value is not valid, the UI will render an appropriate error
message.
If the `PATCH /api/metrics/source/{sourceId}` request to update the
value is manually sent with an invalid value, the server will respond
with a 400 status code and an error message.

Also, for retro compatibility and to not block the user when the
configuration can't be successfully retrieved, in case of internal error
the `GET /api/metrics/source/{sourceId}` will return a 404 and on the
UI, instead of rendering a blank page, the user will see the empty form
and will be able to re-insert the right values.

## Testing

Navigate to `Inventory`-> Click on `Settings` on the topbar -> Start
writing different metric indices in the Metric Indices field.

### Editing Metric Indices validation

https://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov

### Missing/Broken configuration response

https://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit ddcbf73)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.5
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 146272

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 30, 2022
…46272) (#146674)

# Backport

This will backport the following commits from `main` to `8.5`:
- [[Infrastructure UI] Improve metrics settings error handling
(#146272)](#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":"[email protected]"},"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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 30, 2022
…46272) (#146675)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Infrastructure UI] Improve metrics settings error handling
(#146272)](#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":"[email protected]"},"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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <[email protected]>
@tonyghiani
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

tonyghiani added a commit that referenced this pull request Dec 1, 2022
…146272) (#146699)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[Infrastructure UI] Improve metrics settings error handling
(#146272)](#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":"[email protected]"},"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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","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.6.0","v8.7.0","v8.5.3"],"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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/146675","number":146675,"state":"MERGED","mergeCommit":{"sha":"28991d49d86e7cdb2496e0c2fe37cac928c557c2","message":"[8.6]
[Infrastructure UI] Improve metrics settings error handling (#146272)
(#146675)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.6`:\n- [[Infrastructure UI] Improve metrics settings error
handling\n(#146272)](https://github.com/elastic/kibana/pull/146272)\n\n<!---
Backport version: 8.9.7 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Marco
Antonio\nGhiani\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2022-11-30T10:54:37Z\",\"message\":\"[Infrastructure\nUI]
Improve metrics settings error handling
(#146272)\\n\\nCloses\n[#145238](https://github.com/elastic/kibana/issues/145238)\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThese
changes add validation to the Metric Indices passed\ninto
the\\r\\nMetrics settings page.\\r\\nNew validation is added both
in\nthe UI and in the endpoint, performing\\r\\nthe following
checks:\\r\\n-\nIndex pattern is not an empty string\\r\\n- Index
pattern does not contain\nempty spaces (start, middle, end)
(the\\r\\npattern is not trimmed)\\r\\n-\nIndex pattern does not contain
empty entries, comma-separated\nvalues\\r\\nshould have an acceptable
value.\\r\\n\\r\\nIn case the value is\nnot valid, the UI will render an
appropriate error\\r\\nmessage.\\r\\nIf the\n`PATCH
/api/metrics/source/{sourceId}` request to update the\\r\\nvalue
is\nmanually sent with an invalid value, the server will
respond\\r\\nwith a\n400 status code and an error
message.\\r\\n\\r\\nAlso, for retro\ncompatibility and to not block the
user when the\\r\\nconfiguration can't\nbe successfully retrieved, in
case of internal error\\r\\nthe `GET\n/api/metrics/source/{sourceId}`
will return a 404 and on the\\r\\nUI,\ninstead of rendering a blank
page, the user will see the empty\nform\\r\\nand will be able to
re-insert the right values.\\r\\n\\r\\n##\nTesting\\r\\n\\r\\nNavigate
to `Inventory`-> Click on `Settings` on the\ntopbar ->
Start\\r\\nwriting different metric indices in the Metric\nIndices
field.\\r\\n\\r\\n### Editing Metric
Indices\nvalidation\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\\r\\n\\r\\n###\nMissing/Broken
configuration\nresponse\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\\r\\n\\r\\nCo-authored-by:\nMarco
Antonio Ghiani
<[email protected]>\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02\",\"branchLabelMapping\":{\"^v8.7.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Metrics\nUI\",\"Team:Infra
Monitoring\nUI\",\"release_note:skip\",\"backport:all-open\",\"v8.7.0\"],\"number\":146272,\"url\":\"https://github.com/elastic/kibana/pull/146272\",\"mergeCommit\":{\"message\":\"[Infrastructure\nUI]
Improve metrics settings error handling
(#146272)\\n\\nCloses\n[#145238](https://github.com/elastic/kibana/issues/145238)\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThese
changes add validation to the Metric Indices passed\ninto
the\\r\\nMetrics settings page.\\r\\nNew validation is added both
in\nthe UI and in the endpoint, performing\\r\\nthe following
checks:\\r\\n-\nIndex pattern is not an empty string\\r\\n- Index
pattern does not contain\nempty spaces (start, middle, end)
(the\\r\\npattern is not trimmed)\\r\\n-\nIndex pattern does not contain
empty entries, comma-separated\nvalues\\r\\nshould have an acceptable
value.\\r\\n\\r\\nIn case the value is\nnot valid, the UI will render an
appropriate error\\r\\nmessage.\\r\\nIf the\n`PATCH
/api/metrics/source/{sourceId}` request to update the\\r\\nvalue
is\nmanually sent with an invalid value, the server will
respond\\r\\nwith a\n400 status code and an error
message.\\r\\n\\r\\nAlso, for retro\ncompatibility and to not block the
user when the\\r\\nconfiguration can't\nbe successfully retrieved, in
case of internal error\\r\\nthe `GET\n/api/metrics/source/{sourceId}`
will return a 404 and on the\\r\\nUI,\ninstead of rendering a blank
page, the user will see the empty\nform\\r\\nand will be able to
re-insert the right values.\\r\\n\\r\\n##\nTesting\\r\\n\\r\\nNavigate
to `Inventory`-> Click on `Settings` on the\ntopbar ->
Start\\r\\nwriting different metric indices in the Metric\nIndices
field.\\r\\n\\r\\n### Editing Metric
Indices\nvalidation\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\\r\\n\\r\\n###\nMissing/Broken
configuration\nresponse\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\\r\\n\\r\\nCo-authored-by:\nMarco
Antonio Ghiani
<[email protected]>\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"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\nUI]
Improve metrics settings error handling
(#146272)\\n\\nCloses\n[#145238](https://github.com/elastic/kibana/issues/145238)\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThese
changes add validation to the Metric Indices passed\ninto
the\\r\\nMetrics settings page.\\r\\nNew validation is added both
in\nthe UI and in the endpoint, performing\\r\\nthe following
checks:\\r\\n-\nIndex pattern is not an empty string\\r\\n- Index
pattern does not contain\nempty spaces (start, middle, end)
(the\\r\\npattern is not trimmed)\\r\\n-\nIndex pattern does not contain
empty entries, comma-separated\nvalues\\r\\nshould have an acceptable
value.\\r\\n\\r\\nIn case the value is\nnot valid, the UI will render an
appropriate error\\r\\nmessage.\\r\\nIf the\n`PATCH
/api/metrics/source/{sourceId}` request to update the\\r\\nvalue
is\nmanually sent with an invalid value, the server will
respond\\r\\nwith a\n400 status code and an error
message.\\r\\n\\r\\nAlso, for retro\ncompatibility and to not block the
user when the\\r\\nconfiguration can't\nbe successfully retrieved, in
case of internal error\\r\\nthe `GET\n/api/metrics/source/{sourceId}`
will return a 404 and on the\\r\\nUI,\ninstead of rendering a blank
page, the user will see the empty\nform\\r\\nand will be able to
re-insert the right values.\\r\\n\\r\\n##\nTesting\\r\\n\\r\\nNavigate
to `Inventory`-> Click on `Settings` on the\ntopbar ->
Start\\r\\nwriting different metric indices in the Metric\nIndices
field.\\r\\n\\r\\n### Editing Metric
Indices\nvalidation\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\\r\\n\\r\\n###\nMissing/Broken
configuration\nresponse\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\\r\\n\\r\\nCo-authored-by:\nMarco
Antonio Ghiani
<[email protected]>\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Marco Antonio Ghiani
<[email protected]>"}},{"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 <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02"}},{"branch":"8.5","label":"v8.5.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/146674","number":146674,"state":"MERGED","mergeCommit":{"sha":"223121bc5d668f560f609a25a9e08778fa504c50","message":"[8.5]
[Infrastructure UI] Improve metrics settings error handling (#146272)
(#146674)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.5`:\n- [[Infrastructure UI] Improve metrics settings error
handling\n(#146272)](https://github.com/elastic/kibana/pull/146272)\n\n<!---
Backport version: 8.9.7 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Marco
Antonio\nGhiani\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2022-11-30T10:54:37Z\",\"message\":\"[Infrastructure\nUI]
Improve metrics settings error handling
(#146272)\\n\\nCloses\n[#145238](https://github.com/elastic/kibana/issues/145238)\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThese
changes add validation to the Metric Indices passed\ninto
the\\r\\nMetrics settings page.\\r\\nNew validation is added both
in\nthe UI and in the endpoint, performing\\r\\nthe following
checks:\\r\\n-\nIndex pattern is not an empty string\\r\\n- Index
pattern does not contain\nempty spaces (start, middle, end)
(the\\r\\npattern is not trimmed)\\r\\n-\nIndex pattern does not contain
empty entries, comma-separated\nvalues\\r\\nshould have an acceptable
value.\\r\\n\\r\\nIn case the value is\nnot valid, the UI will render an
appropriate error\\r\\nmessage.\\r\\nIf the\n`PATCH
/api/metrics/source/{sourceId}` request to update the\\r\\nvalue
is\nmanually sent with an invalid value, the server will
respond\\r\\nwith a\n400 status code and an error
message.\\r\\n\\r\\nAlso, for retro\ncompatibility and to not block the
user when the\\r\\nconfiguration can't\nbe successfully retrieved, in
case of internal error\\r\\nthe `GET\n/api/metrics/source/{sourceId}`
will return a 404 and on the\\r\\nUI,\ninstead of rendering a blank
page, the user will see the empty\nform\\r\\nand will be able to
re-insert the right values.\\r\\n\\r\\n##\nTesting\\r\\n\\r\\nNavigate
to `Inventory`-> Click on `Settings` on the\ntopbar ->
Start\\r\\nwriting different metric indices in the Metric\nIndices
field.\\r\\n\\r\\n### Editing Metric
Indices\nvalidation\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\\r\\n\\r\\n###\nMissing/Broken
configuration\nresponse\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\\r\\n\\r\\nCo-authored-by:\nMarco
Antonio Ghiani
<[email protected]>\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02\",\"branchLabelMapping\":{\"^v8.7.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Metrics\nUI\",\"Team:Infra
Monitoring\nUI\",\"release_note:skip\",\"backport:all-open\",\"v8.7.0\"],\"number\":146272,\"url\":\"https://github.com/elastic/kibana/pull/146272\",\"mergeCommit\":{\"message\":\"[Infrastructure\nUI]
Improve metrics settings error handling
(#146272)\\n\\nCloses\n[#145238](https://github.com/elastic/kibana/issues/145238)\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThese
changes add validation to the Metric Indices passed\ninto
the\\r\\nMetrics settings page.\\r\\nNew validation is added both
in\nthe UI and in the endpoint, performing\\r\\nthe following
checks:\\r\\n-\nIndex pattern is not an empty string\\r\\n- Index
pattern does not contain\nempty spaces (start, middle, end)
(the\\r\\npattern is not trimmed)\\r\\n-\nIndex pattern does not contain
empty entries, comma-separated\nvalues\\r\\nshould have an acceptable
value.\\r\\n\\r\\nIn case the value is\nnot valid, the UI will render an
appropriate error\\r\\nmessage.\\r\\nIf the\n`PATCH
/api/metrics/source/{sourceId}` request to update the\\r\\nvalue
is\nmanually sent with an invalid value, the server will
respond\\r\\nwith a\n400 status code and an error
message.\\r\\n\\r\\nAlso, for retro\ncompatibility and to not block the
user when the\\r\\nconfiguration can't\nbe successfully retrieved, in
case of internal error\\r\\nthe `GET\n/api/metrics/source/{sourceId}`
will return a 404 and on the\\r\\nUI,\ninstead of rendering a blank
page, the user will see the empty\nform\\r\\nand will be able to
re-insert the right values.\\r\\n\\r\\n##\nTesting\\r\\n\\r\\nNavigate
to `Inventory`-> Click on `Settings` on the\ntopbar ->
Start\\r\\nwriting different metric indices in the Metric\nIndices
field.\\r\\n\\r\\n### Editing Metric
Indices\nvalidation\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\\r\\n\\r\\n###\nMissing/Broken
configuration\nresponse\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\\r\\n\\r\\nCo-authored-by:\nMarco
Antonio Ghiani
<[email protected]>\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"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\nUI]
Improve metrics settings error handling
(#146272)\\n\\nCloses\n[#145238](https://github.com/elastic/kibana/issues/145238)\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThese
changes add validation to the Metric Indices passed\ninto
the\\r\\nMetrics settings page.\\r\\nNew validation is added both
in\nthe UI and in the endpoint, performing\\r\\nthe following
checks:\\r\\n-\nIndex pattern is not an empty string\\r\\n- Index
pattern does not contain\nempty spaces (start, middle, end)
(the\\r\\npattern is not trimmed)\\r\\n-\nIndex pattern does not contain
empty entries, comma-separated\nvalues\\r\\nshould have an acceptable
value.\\r\\n\\r\\nIn case the value is\nnot valid, the UI will render an
appropriate error\\r\\nmessage.\\r\\nIf the\n`PATCH
/api/metrics/source/{sourceId}` request to update the\\r\\nvalue
is\nmanually sent with an invalid value, the server will
respond\\r\\nwith a\n400 status code and an error
message.\\r\\n\\r\\nAlso, for retro\ncompatibility and to not block the
user when the\\r\\nconfiguration can't\nbe successfully retrieved, in
case of internal error\\r\\nthe `GET\n/api/metrics/source/{sourceId}`
will return a 404 and on the\\r\\nUI,\ninstead of rendering a blank
page, the user will see the empty\nform\\r\\nand will be able to
re-insert the right values.\\r\\n\\r\\n##\nTesting\\r\\n\\r\\nNavigate
to `Inventory`-> Click on `Settings` on the\ntopbar ->
Start\\r\\nwriting different metric indices in the Metric\nIndices
field.\\r\\n\\r\\n### Editing Metric
Indices\nvalidation\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763021-0f4d8926-ffa4-448a-a038-696732158f4e.mov\\r\\n\\r\\n###\nMissing/Broken
configuration\nresponse\\r\\n\\r\\n\\r\\nhttps://user-images.githubusercontent.com/34506779/203763120-ffc91cd3-9bf4-43da-a04f-5561ceabf591.mov\\r\\n\\r\\nCo-authored-by:\nMarco
Antonio Ghiani
<[email protected]>\\r\\nCo-authored-by:\nkibanamachine\n<[email protected]>\",\"sha\":\"ddcbf73284d48b1f1f6eb9322f6f108f312f8e02\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Marco Antonio Ghiani <[email protected]>"}}]}] BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release Feature:Metrics UI Metrics UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.17.8 v8.5.3 v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metrics] Improve settings error handling
6 participants