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] Data stream edit data retention #167006

Merged

Conversation

sabarasaba
Copy link
Member

@sabarasaba sabarasaba commented Sep 22, 2023

Fixes: #165136

Summary

This PR adds support for editing data retention for a data stream.

How to test
  1. Start elasticsearch with yarn es snapshot --license=trial and serverless search solution with yarn start
  2. Navigate to console and execute the commands listed below in order to create a policy
  3. Navigate to index management and click on data streams tab
  4. Verify that:
  • You can edit the data retention, and its reflected in the table and details flyout
  • If you set infinite data retention, it should be reflected in the table and details flyout. And when the edit form is open again the toggle should be enabled.
  • If infinite toggle is enabled, you shouldnt be allowed to edit data retention values
  • If the data stream is managed by ILM, the edit data retention option shouldnt be shown
Creating a test data stream
PUT _index_template/b-index-template
{
  "index_patterns": ["b-data-stream*"],
  "data_stream": { },
  "priority": 500,
  "template": {
    "lifecycle": {
      "enabled": false
    }
  },
  "_meta": {
    "description": "Template with data stream lifecycle"
  }
}

PUT _data_stream/b-data-stream

PUT b-data-stream/_bulk
{ "create":{ } }
{ "@timestamp": "2099-05-06T16:21:15.000Z", "message": "192.0.2.42 - - [06/May/2099:16:21:15 +0000] \"GET /images/bg.jpg HTTP/1.0\" 200 24736" }
{ "create":{ } }
{ "@timestamp": "2099-05-06T16:25:42.000Z", "message": "192.0.2.255 - - [06/May/2099:16:25:42 +0000] \"GET /favicon.ico HTTP/1.0\" 200 3638" }
Screenshots

Screenshot 2023-09-29 at 11 15 50

@sabarasaba sabarasaba added Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.11.0 labels Sep 22, 2023
@sabarasaba sabarasaba self-assigned this Sep 22, 2023
@sabarasaba
Copy link
Member Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@sabarasaba sabarasaba marked this pull request as ready for review September 26, 2023 11:16
@sabarasaba sabarasaba requested a review from a team as a code owner September 26, 2023 11:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

@alisonelizabeth alisonelizabeth added the ci:cloud-deploy Create or update a Cloud deployment label Sep 26, 2023
@alisonelizabeth
Copy link
Contributor

@elasticmachine merge upstream

@sabarasaba sabarasaba requested a review from gchaps September 27, 2023 13:27
Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Really great work @sabarasaba! Thanks for the quick turnaround on this. I tried to test all the different combinations and everything worked as expected (with the known usability issues) - DSL enabled, DSL disabled, DSL enabled with predefined retention, ILM + DSL enabled. Left some comments in the code.

Also, a few other observations:

const descriptionListColumnTwo = descriptionListItems.slice(midpoint, descriptionListItems.length);
  • [Follow up] If a user selects "Never delete data" and saves, I think we should represent this in the table view as well (right now this translates as an empty table cell for the "Data retention" column). This is probably more appropriate as a follow-up PR, but just something I noticed and wanted to call out.
  • [Follow up] We might want to consider creating human readable units to display in the table. For example 7m could be interpreted as "minutes" or "months". Again, not directly related to your work, just something I noticed.

@florent-leborgne
Copy link
Contributor

Hey @sabarasaba, I'll review the copy today on behalf of @gchaps.

@sabarasaba
Copy link
Member Author

@elasticmachine merge upstream

@sabarasaba
Copy link
Member Author

Thanks for the review @alisonelizabeth! I've addressed your feedback with 59ba5f6 and created a new issue for dealing with the two issues you mentioned above about being more explicit about data retention period in the UI.

Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

Hey @sabarasaba. I've suggested a few edits. Also have a few questions/remarks for things I'm not sure of:

  • I was not sure of what to suggest for the warning, but I think we can make it clearer. See my comments in the review

  • Another thing that caught my attention are the shortened time values we use.

    • I understand that they match with the API but "nanos" "micros" etc. sound quite unusual to me compared to common abbreviations (d, h, min, sec, ms, µs, ns) or fully developed forms if we have enough space for it, like 3000 microseconds
    • This maybe also has to do with the API but we render the value with no space in the flyout, while the best practice would be to have a (non-breaking) space between the number and the unit. (30 ns, 4 days, instead of 30ns, 4days). I see it's similar for the storage size so at least it's consistent, but if we can consider changing this at some point in the UI, it would be great.
image
  • Tooltips for "Data retention" differ in the flyout and in the data stream list. I'm not sure if they are still correct, especially the long one? Happy to help revisit them once I'm a bit more sure about the actual behavior ^^'
Pasted Graphic Pasted Graphic 1
  • Not a content comment, but is it the expected behavior that once we edit the data retention, the flyout also closes?

@sabarasaba
Copy link
Member Author

Thanks for the review @florent-leborgne! I've addressed some of your feedback with 0034336 and I've created this issue to address some of the other smaller things you mentioned.

In regards of the tooltip content, I'm not sure if thats a regresion or not cc: @alisonelizabeth.

Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

Approving latest copy while noting that pending comments will be addressed through separate issues as discussed. Thanks!

@sabarasaba sabarasaba removed the request for review from gchaps September 28, 2023 15:32
@sabarasaba sabarasaba requested a review from a team as a code owner September 29, 2023 07:37
Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot for working on this feature, @sabarasaba!
Left just a couple of nits in the code, but the latest changes LGTM 👍

kibanamachine and others added 23 commits September 29, 2023 13:02
@sabarasaba sabarasaba force-pushed the index_management-ds_edit_data_retention branch from 6b95d72 to 8189921 Compare September 29, 2023 11:09
@sabarasaba
Copy link
Member Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 29, 2023

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
indexManagement 586 589 +3

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
indexManagement 192 194 +2

Async chunks

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

id before after diff
indexManagement 553.0KB 560.2KB +7.1KB
lists 146.9KB 147.0KB +81.0B
total +7.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 367.8KB 367.8KB +81.0B
indexManagement 33.1KB 33.3KB +145.0B
total +226.0B
Unknown metric groups

API count

id before after diff
indexManagement 197 199 +2

History

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

cc @sabarasaba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:cloud-deploy Create or update a Cloud deployment Feature:Index Management Index and index templates UI release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Index Management] Ability to edit data retention
8 participants