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

[Index Management] [Serverless] Display index and data stream size #190131

Closed
alisonelizabeth opened this issue Aug 8, 2024 · 6 comments · Fixed by #191985
Closed

[Index Management] [Serverless] Display index and data stream size #190131

alisonelizabeth opened this issue Aug 8, 2024 · 6 comments · Fixed by #191985
Assignees
Labels
enhancement New value added to drive a business result Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@alisonelizabeth
Copy link
Contributor

alisonelizabeth commented Aug 8, 2024

We need to surface the size and documents count in Index Management in serverless. This applies to indices and data streams.

The Elasticsearch team recently implemented a _metering/stats API that should return this information.

Designs

Image
Image
Image

@alisonelizabeth alisonelizabeth added enhancement New value added to drive a business result Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more labels Aug 8, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@yuliacech
Copy link
Contributor

yuliacech commented Aug 8, 2024

After testing the _metering/stats API and confirming with the ES team, I think we could add the size (and docs count) to the Indices and Datastreams tabs in Index Management as following:

await client.asSecondaryAuthUser.transport.request({
      method: 'GET',
      path: `/_metering/stats`,
    });
  • The API response should look like
{
  _total: { num_docs: 16, size_in_bytes: 93208 },
  indices: [ array of indices stats ],
  datastreams: [ array of data streams stats ]
}
// index stats 
{
  name: '.ds-.kibana-event-log-ds-2024.08.07-000003',
  datastream: '.kibana-event-log-ds',
  num_docs: 19,
  size_in_bytes: 111792
}

// datastream stats
{ 
  name: '.kibana-event-log-ds', 
  num_docs: 23,
  size_in_bytes: 234534
}
  • The API could also be used for individual indices/datastreams GET /_metering/stats/{index_pattern}
  • Since the ES client also sends the actual user data to the ES, the response of the API only returns matched indices/datastreams that the user have permissions for.
  • If no indices/datastreams are found, the API returns 404.
  • According to the ES team, the sizes and docs counts are not recalculated on every request, so it should not affect the performance of the deployment.

@joemcelroy
Copy link
Member

joemcelroy commented Aug 28, 2024

For the upcoming onboarding work with search index detail page, we need to add doc + size information to the index GET API route. We (search solution team) plan to add this.

I discussed with @yuliacech as we plan to:

  • introduce a new config variable isSizeAndDocCountEnabled which will only be enabled for ES3 elasticsearch project
  • return both size and doc count when this boolean is enabled to fetch_indices API

https:/elastic/kibana/blob/main/x-pack/plugins/index_management/server/lib/fetch_indices.ts#L46

Edit: PR Opened https:/elastic/kibana/pull/191631/files#

@alisonelizabeth
Copy link
Contributor Author

Updated issue to include designs

@alisonelizabeth
Copy link
Contributor Author

alisonelizabeth commented Aug 28, 2024

introduce a new config variable isSizeAndDocCountEnabled which will only be enabled for ES3 elasticsearch project

@joemcelroy Is it necessary to only enable this for ES3? Once this issue is implemented, it will be leveraged for all project types.

@joemcelroy
Copy link
Member

joemcelroy commented Aug 29, 2024

introduce a new config variable isSizeAndDocCountEnabled which will only be enabled for ES3 elasticsearch project

@joemcelroy Is it necessary to only enable this for ES3? Once this issue is implemented, it will be leveraged for all project types.

So my thinking was that I would only add it to ES3 elasticsearch projects and let Appex roll out the changes across the other project types.

I've changed that stance now and my PR will now enable it for all ES3 project types. This is due to challenges with the common FTR tests that are used across all solutions. Having only one project type enabled will cause larger changes within the API FTRs to be solution independent. Its simpler to enable the change across all and update the test.

yuliacech added a commit that referenced this issue Sep 16, 2024
## Summary

Fixes #190131

This PR adds size and documents count to indices and data streams tables
in Index Management on serverless.

### Screenrecording



https:/user-attachments/assets/51a933e2-e4ef-42a0-9c82-39bf6e194ee0



### Screenshots 
<img width="1047" alt="Screenshot 2024-09-06 at 19 20 59"
src="https:/user-attachments/assets/8c6d0378-116f-44e3-aaca-0c95f135b1bf">
<img width="1045" alt="Screenshot 2024-09-06 at 19 21 06"
src="https:/user-attachments/assets/37477f7b-e229-4400-9a28-8382f7d1155e">
<img width="1036" alt="Screenshot 2024-09-06 at 19 27 59"
src="https:/user-attachments/assets/0fd2ef1b-3b0c-4d3e-8b56-984281436898">
<img width="506" alt="Screenshot 2024-09-06 at 19 28 12"
src="https:/user-attachments/assets/1823a964-6f6f-464b-9910-e586ccd2e9bb">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https:/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https:/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https:/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
markov00 pushed a commit to markov00/kibana that referenced this issue Sep 18, 2024
…191985)

## Summary

Fixes elastic#190131

This PR adds size and documents count to indices and data streams tables
in Index Management on serverless.

### Screenrecording



https:/user-attachments/assets/51a933e2-e4ef-42a0-9c82-39bf6e194ee0



### Screenshots 
<img width="1047" alt="Screenshot 2024-09-06 at 19 20 59"
src="https:/user-attachments/assets/8c6d0378-116f-44e3-aaca-0c95f135b1bf">
<img width="1045" alt="Screenshot 2024-09-06 at 19 21 06"
src="https:/user-attachments/assets/37477f7b-e229-4400-9a28-8382f7d1155e">
<img width="1036" alt="Screenshot 2024-09-06 at 19 27 59"
src="https:/user-attachments/assets/0fd2ef1b-3b0c-4d3e-8b56-984281436898">
<img width="506" alt="Screenshot 2024-09-06 at 19 28 12"
src="https:/user-attachments/assets/1823a964-6f6f-464b-9910-e586ccd2e9bb">



### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https:/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https:/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https:/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 23, 2024
…191985)

## Summary

Fixes elastic#190131

This PR adds size and documents count to indices and data streams tables
in Index Management on serverless.

### Screenrecording

https:/user-attachments/assets/51a933e2-e4ef-42a0-9c82-39bf6e194ee0

### Screenshots
<img width="1047" alt="Screenshot 2024-09-06 at 19 20 59"
src="https:/user-attachments/assets/8c6d0378-116f-44e3-aaca-0c95f135b1bf">
<img width="1045" alt="Screenshot 2024-09-06 at 19 21 06"
src="https:/user-attachments/assets/37477f7b-e229-4400-9a28-8382f7d1155e">
<img width="1036" alt="Screenshot 2024-09-06 at 19 27 59"
src="https:/user-attachments/assets/0fd2ef1b-3b0c-4d3e-8b56-984281436898">
<img width="506" alt="Screenshot 2024-09-06 at 19 28 12"
src="https:/user-attachments/assets/1823a964-6f6f-464b-9910-e586ccd2e9bb">

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https:/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https:/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https:/elastic/kibana/blob/main/RISK_MATRIX.mdx) |

### For maintainers

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

(cherry picked from commit 3de252e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants