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
Expose the index age in ILM explain output. #81273
Conversation
3ffb124
to
eeeeee8
Compare
eeeeee8
to
2ca89b0
Compare
ILM already exposes the `age` that ILM will use to transition to the next phase, based on that phase's `min_age`. The `index_age` is based only on the index creation date and it's used to trigger a rollover. Resolves elastic#64429
2ca89b0
to
beb09b1
Compare
Pinging @elastic/es-data-management (Team:Data Management) |
@elasticmachine run elasticsearch-ci/part-2 |
@elasticmachine update branch |
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this Mary.
I think this generally looks good, I've left a few comments.
...lugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/IndexLifecycleExplainResponse.java
Outdated
Show resolved
Hide resolved
.../ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java
Outdated
Show resolved
Hide resolved
.../ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java
Outdated
Show resolved
Hide resolved
.../ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java
Outdated
Show resolved
Hide resolved
.../ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/ExplainLifecycleIT.java
Outdated
Show resolved
Hide resolved
"index_creation_date_millis": 1538475653281, | ||
"index_age": "15s", <1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagging @debadair, who has more ILM experience and can probably give better feedback. :)
Instead of index_age
, I'd go with something a little more descriptive like time_since_index_creation
or time_since_creation
. That avoids conflation with age
and min_age
.
Ideally, we would change age
to a more descriptive key too, but that would require a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that I think index_age
is a little confusing, perhaps something like creation_age
, or lifetime
would be my suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like that name, it does feel a bit weird that it is not inline with the other age
though. Is there any convention we use for such fields in our APIs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I could justify a breaking change to the age
key name assuming
- there are not any known consumers of this API (other then humans )
- it can help make a meaningful difference how we express timings.
For example, if makes sense to keep index_age here but change age
to phase_age
in 8.0.0 I think that should be on the table too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the ideas, I will bring these options to the team and come back with a proposal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our proposal is:
age
remains the same because it's already used by kibana so breaking backwards compatibility is not as painless.time_since_index_creation
will be the name of the new exposed field to make it as clear as possible and we intentionally want to avoid the word age so the two will not be easier distinguishable.
Thank you all for helping out :).
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for iterating on this @gmarouli
This makes the ages math a lot clearer.
I've left 2 minor suggestions.
"policy": "my_policy", <2> | ||
"lifecycle_date_millis": 1538475653281, <3> | ||
"age": "15s", <4> | ||
"index_creation_date_millis": 1538475653281, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we document this as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, documentation added
ILM already exposes the
age
that ILM will use to transition to the next phase, based on that phase'smin_age
. Theindex_age
is based only on the index creation date and it's used to trigger a rollover.Resolves #64429