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

Cat endpoint for data streams #65238

Open
joegallo opened this issue Nov 18, 2020 · 8 comments
Open

Cat endpoint for data streams #65238

joegallo opened this issue Nov 18, 2020 · 8 comments
Labels
:Data Management/CAT APIs Text APIs behind /_cat :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team

Comments

@joegallo
Copy link
Contributor

joegallo commented Nov 18, 2020

Along similar lines as _cat/aliases and _cat/indices, we should have a _cat/data_streams.

Perhaps something like:

GET _cat/data_streams&v
data_stream    status generation template      ilm_policy  [...]
my-data-stream yellow          1 some-template some-policy [...]

Also, there's already _cat/templates, but there's no _cat API for ILM Policies (#29690 has a checkbox for it). It probably makes sense to add that, too, perhaps as a followup.

/cc @dakrone @martijnvg

@joegallo joegallo added :Data Management/CAT APIs Text APIs behind /_cat :Data Management/Data streams Data streams and their lifecycles labels Nov 18, 2020
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Nov 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@danhermann
Copy link
Contributor

I'd suggest including a count of backing indices. And maybe excluding the generation as it's of marginal value.

@joegallo
Copy link
Contributor Author

+1, but doesn't the generation tell you the number of backing indices?

@danhermann
Copy link
Contributor

+1, but doesn't the generation tell you the number of backing indices?

No, the generation has turned out to be just a counter for the number of times the rollover API has been called on the data stream. That will diverge from the number of backing indices as older backing indices are deleted or if the data stream migration API is used to create a new data stream from an alias pointing to more than one index.

@joegallo
Copy link
Contributor Author

Ahhhh yes, of course. Thanks!

@VimCommando
Copy link
Contributor

I would be very useful to include the current write index for the data stream. That is not easy to determine in the current API output.

@danhermann
Copy link
Contributor

+1, but doesn't the generation tell you the number of backing indices?

No, the generation has turned out to be just a counter for the number of times the rollover API has been called on the data stream. That will diverge from the number of backing indices as older backing indices are deleted or if the data stream migration API is used to create a new data stream from an alias pointing to more than one index.

Just an update for posterity -- the generation is no longer even a counter for the number of rollover operations since there are now other operations that increment the generation. It's an implementation that shouldn't be relied upon for anything other than a monotonically increasing value attached to the names generated for backing indices.

@danhermann
Copy link
Contributor

I would be very useful to include the current write index for the data stream. That is not easy to determine in the current API output.

That's something that would make sense to add to the GET _data_stream API. It wouldn't fit as neatly into a cat API, especially since, unlike the JSON responses to most APIs, the fixed-width text responses from cat APIs are intended explicitly for human consumption and not machine consumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/CAT APIs Text APIs behind /_cat :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

4 participants