[Logs UI] Limit extendDatemath
to valid ranges
#71113
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are cases where either Elasticsearch or the JS runtime will fail if the extended datemath expression goes beyond a certain limit.
In the case of ES, if the new date results in a UNIX epoch smaller than 0, it will crash. In the case of the JS runtime, it will crash if the UNIX epoch is higher than 8,640,000,000,000,000ms.
These limits resulted in the UI either having a broken state or raising an exception.
Fixes #67683
How to test
The easiest way to test both ranges is to limit the log stream to one line. To do so, open the details of any line and apply the filter in the
_id
field.Once applied, change the date range to the following:
epoch 0
in your time zone, like "Jan 2, 1970 @ 00:00:00.000"The UI shouldn't show the buttons to extend the date range.
Checklist