-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 TSDB downsampling ILM configuration #138748
Conversation
@elasticmachine merge upstream |
51107de
to
5d7a792
Compare
@elasticmachine merge upstream |
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
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.
Great work @Dosant !
I had two observations I wanted to get y'alls thoughts on (both non-blockers):
First: @yuliacech (and @Dosant) as I was interacting with this beast of a form I thought one thing that could be really useful is to add the ability to filter out actions - maybe like a global fuzzy matcher so that if I type "down" then all the advanced options will auto expand and show only matching actions. This increases the chances that you'll be able to see the continuity between all relevant config more easily. (I'm thinking of this as a future enhancement of course). Similar to the UX you get when searching for settings in VS Code:
Second: When I enable the downsampling action for the first time the field starts in an errored state.
I'm guessing this is because the form is not in a pristine state anymore (you need to enable the action). Would it be possible to have a default value here?
Otherwise, this PR LGTM tested locally.
x-pack/plugins/index_lifecycle_management/common/types/policies.ts
Outdated
Show resolved
Hide resolved
return { | ||
message: i18n.translate( | ||
'xpack.indexLifecycleMgmt.editPolicy.downsamplePreviousIntervalWarmPhaseError', | ||
{ | ||
defaultMessage: | ||
'Must be greater than and a multiple of the hot phase value ({value})', | ||
values: { | ||
value: intervalValues.hot.esFormat, | ||
}, | ||
} | ||
), | ||
}; |
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.
Do we want to provide a pre-filled number for downsampling here? One thing that is tricky about this form is how big it is and I feel like scrolling between phases you can easily get distracted by all the shiny things.
One alternative I thought of was providing a list of multiples in the error message like: (ex. 10 days, 20 days...)
Might not be worth the effort.
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.
Do we want to provide a pre-filled number for downsampling here?
As I understand, this isn't a low effort because this wouldn't be just a static value and have to depend on the previous step:
e.g., if someone configured a 1-day interval in a hot phase and then enabled a warm phase, then we should prefill with e.g., 2 days. As I understand, such support for "dynamic" initial values needs to be implemented first
Also really not sure what could be good defaults here.
One alternative I thought of was providing a list of multiples in the error message like: (ex. 10 days, 20 days...)
Could be!
cc @ghudgins
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.
lets worry about optimizations and better defaults in subsequent PRs. hard to say what the rule should be without spending some time with it / hearing from users
@elasticmachine merge upstream |
This was because I validated the interval for the current and next phases when downsample action was toggled. I fixed this by validating only the next phases when it is toggled.
note: there is the following edge case:
To fix this, we need to validate downsample actions when steps are toggled. But I thought this is an overkill for this edge case. |
Hey @jloleysens, thanks a lot for this suggestion, I think that is a great idea for the ILM form, it's becoming scarier with each PR 😆 Do you mind opening an issue for that so we don't forget? Thanks a lot for working on this feature @Dosant! I had a quick look and the validation worked correctly for me. I agree with JL that the interval input should not be marked as error as soon as the user toggles the Downsampling action. I think there is some similar logic in the MinAge field. The field is required if the phase is enabled but it's nor marked as error straight away. Also there is similar validation logic in this field, because the MinAge can't be smaller than in the previous phase. Also is the Downsampling action also available in the Frozen phase? A suggestion I have for a follow up PR: since downsampling turns the index read-only automatically, I think we could hide the ReadOnly action in the phase if there is a downsampling action enabled in it or in any of the previous phases. Could you please add the Downsampling action to this text in the Hot phase? |
this should be fixed 👍 #138748 (comment)
No! only hot,warm,cold
Good suggestion. I will create an issue and will try in a separate pr #140515
👍 |
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.
Nice work @Dosant!
I agree with Yulia and JL's comments on looking into ways we can improve the usability of the form in a future iteration.
I left some minor code comments, nothing blocking.
Also is the Downsampling action also available in the Frozen phase?
No! only hot,warm,cold
I noticed in your last comment on the issue, you mentioned it should be available in the frozen phase, but is not yet available in ES. Is this future work?
|
||
// disable warm phase; | ||
await actions.togglePhase('warm'); | ||
// TODO: there is a bug that disabling a phase doesn't trigger downsample validation in other phases, |
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.
Is there a separate issue open to address this? Will the validation work as expected on save?
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.
Will the validation work as expected on saving?
Yes! the form state stays in the error state until the validation is triggered again.
More details on the case here: #138748 (comment)
note: there is the following edge case:
Have the warm downsample action enabled and set 1d
Have the cold downsample action enabled and set 1d -> see the error
Disable the warm step completely -> error on cold downsample action is still there > until triggering change or saving.
To fix this, we need to validate downsample actions when steps are toggled. But I thought this is an overkill for this edge case.
Is there a separate issue open to address this?
I wanted to leave a TODO comment to point this out as a known bug/edge case but didn't think this was worth an issue
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'll see if I can fix this with low effort: #140628
['Must be greater than and a multiple of the hot phase value (60m)'], | ||
'cold' | ||
); | ||
}, /* increase a timeout of this test as it could fail on ci*/ 12000); |
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.
Out of curiosity - is there any more context you can provide here? Was the test failing without the increased timeout?
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.
It was failing with a 5-second timeout because it was a very long test. initially, I also implemented a frozen phase and tested it here. Since we removed the frozen phase, I also removed a timeout, as I expect it should fit in 5 seconds now.
defaultMessage="Roll up documents within a fixed interval to a single summary document. Reduces the index footprint by storing time series data at reduced granularity." | ||
/>{' '} | ||
{/* TODO: add when available*/} | ||
{/* <LearnMoreLink docPath={docLinks.links.elasticsearch.ilmDownsample} /> */} |
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.
Is this documentation planned, or already in progress? I'm wondering if it makes sense to remove this code until it is ready.
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 believe this is planned: #130437 (comment) cc @debadair
/* | ||
* Labels for fixed intervals | ||
*/ | ||
export const fixedIntervalUnits = [ |
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 see we already have a timeUnits
const. Just want to confirm these values should be separate?
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.
micros and nanos are technically not supported for the fixed interval.
btw, I saw this: #137081
I think we can unite these consts if we remove everything smaller then a minute
@@ -0,0 +1,130 @@ | |||
/* |
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 adding these tests 👍
There was some back-and-forth :( |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
@Dosant I forgot to ask during my review - I noticed you have the |
Summary
Close #130437
Enables TSDB downsampling action in ILM configuration.
Actions can be set in the hot, warm, cold phases.
Users need to specify an interval:
Intervals have the following validation:
How to test
(What I tested)
Note
Release Notes
Enables time series downsampling action in ILM configuration