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

Enable stream stats in serverless #197038

Conversation

SoniaSanzV
Copy link
Contributor

@SoniaSanzV SoniaSanzV commented Oct 21, 2024

Closes #192584

Summary

This PR sets the value of xpack.index_management.enableDataStreamStats to true in Serverless. The objective is to display the “Last updated” column in Index Management > Data Streams Table (propety is maximun_timestamp). It can be enabled now since the maximum_timestamp property was added to the Get data stream API (see elastic/elasticsearch#112303).

On the @elastic/kibana-management side, I've been looking at it carefully and I think only this change in config/serverless.yml. The rest of the necessary changes were already incorporated in this PR, testing included.
With this change the column is now displayed as expected:
197038

I'm adding kibana-management as a reviewer just in case I'm missing something

@SoniaSanzV SoniaSanzV self-assigned this Oct 21, 2024
@SoniaSanzV SoniaSanzV 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:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 21, 2024
@SoniaSanzV SoniaSanzV requested a review from a team October 21, 2024 13:10
@SoniaSanzV SoniaSanzV marked this pull request as ready for review October 21, 2024 13:10
@SoniaSanzV SoniaSanzV requested review from a team as code owners October 21, 2024 13:10
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 21, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #9 / Serverless Common UI - Management Index Management Data Streams allows to update data retention
  • [job] [logs] FTR Configs #9 / Serverless Common UI - Management Index Management Data Streams allows to update data retention
  • [job] [logs] FTR Configs #62 / Serverless Index Management APIs Data streams Get returns a single data stream by ID
  • [job] [logs] FTR Configs #64 / Serverless Index Management APIs Data streams Get returns a single data stream by ID
  • [job] [logs] FTR Configs #68 / Serverless Index Management APIs Data streams Get returns a single data stream by ID
  • [job] [logs] FTR Configs #64 / Serverless Index Management APIs Data streams Get returns a single data stream by ID
  • [job] [logs] FTR Configs #62 / Serverless Index Management APIs Data streams Get returns a single data stream by ID
  • [job] [logs] FTR Configs #68 / Serverless Index Management APIs Data streams Get returns a single data stream by ID

Metrics [docs]

✅ unchanged

History

cc @SoniaSanzV

@SoniaSanzV SoniaSanzV marked this pull request as draft October 21, 2024 14:42
@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@mattkime mattkime self-requested a review October 21, 2024 20:15
@ElenaStoeva
Copy link
Contributor

Hey @SoniaSanzV, thanks for picking this up! I think additional changes would be needed for this enhancement. If we set enableDataStreamStats to true in serverless, we would use the Get datastreams stats API (see here) but we don't want to display results from this API in serverless. We should instead use the Get data stream API which should now return a maximum_timestamp property which has the value that we want to display in the UI.

@SoniaSanzV
Copy link
Contributor Author

Hey @SoniaSanzV, thanks for picking this up! I think additional changes would be needed for this enhancement. If we set enableDataStreamStats to true in serverless, we would use the Get datastreams stats API (see here) but we don't want to display results from this API in serverless. We should instead use the Get data stream API which should now return a maximum_timestamp property which has the value that we want to display in the UI.

I completely misunderstood, I thought the API was the same (the name is similar and I wasn't familiar with any of them). I'll continue to work on it.

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Just wanted to FYI in case this hasn't been tested in QA, you can use the following label ci:project-deploy-elasticsearch and buildkite will provision a project based on this PR for manually testing in serverless.

@SoniaSanzV
Copy link
Contributor Author

Just wanted to FYI in case this hasn't been tested in QA, you can use the following label ci:project-deploy-elasticsearch and buildkite will provision a project based on this PR for manually testing in serverless.

Thank you for the info. I changed the status of the PR to Draft because it needs more work.

@SoniaSanzV
Copy link
Contributor Author

As this task has been stopped for quite some time, I think I should give an update on the status. After talking with Elena we saw that maybe you can use this same endpoint in stateful instead of using GET /_data_stream/{name}/_stats in one place and GET /_data_stream/{name}/verbose in another. I have asked Lee Hinman about this.
Second, when I tried to use the endpoint with the wildcard and the verbose flag in the console it returns a permissions error. This does not happen if you enter the name of a data stream. I need to investigate this further as the field is wanted to be displayed in the table.

Example request:

GET /_data_stream/*?expand_wildcards=all&verbose

Response:

{
  "error": {
    "root_cause": [
      {
        "type": "security_exception",
        "reason": "action [indices:monitor/data_stream/stats] is unauthorized for user [_xpack] with effective roles [_xpack] on restricted indices [.security-7,.security-profile-8], this action is granted by the index privileges [monitor,manage,all]"
      }
    ],
    "type": "security_exception",
    "reason": "action [indices:monitor/data_stream/stats] is unauthorized for user [_xpack] with effective roles [_xpack] on restricted indices [.security-7,.security-profile-8], this action is granted by the index privileges [monitor,manage,all]"
  },
  "status": 403
}

@SoniaSanzV SoniaSanzV force-pushed the IdxMgmt/lastUpdatedColumnServerless_#192584 branch from e089bbf to f69df81 Compare November 11, 2024 11:39
Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Changes in config/serverless.yml and test/plugin_functional/test_suites/core_plugins/rendering.ts LGTM

@SoniaSanzV SoniaSanzV closed this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Index Management] Add "Last updated" column to Data streams table in Serverless
5 participants