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

[Logs UI] Limit extendDatemath to valid ranges #71113

Merged
merged 3 commits into from
Jul 10, 2020

Conversation

afgomez
Copy link
Contributor

@afgomez afgomez commented Jul 8, 2020

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:

  • start: Absolute, and a value close to epoch 0 in your time zone, like "Jan 2, 1970 @ 00:00:00.000"
  • end: absolute, with a ridiculously high year, like "Jul 8, 154107 @ 18:08:10.269"

The UI shouldn't show the buttons to extend the date range.

Screenshot 2020-07-08 at 17 56 54

Checklist

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][1].

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
@afgomez afgomez added Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes v7.9.0 labels Jul 8, 2020
@afgomez afgomez added this to the Logs UI 7.9 milestone Jul 8, 2020
@afgomez afgomez requested a review from a team as a code owner July 8, 2020 16:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@afgomez
Copy link
Contributor Author

afgomez commented Jul 9, 2020

@elasticmachine merge upstream

@Kerry350 Kerry350 self-requested a review July 9, 2020 10:22
@afgomez
Copy link
Contributor Author

afgomez commented Jul 9, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@Zacqary Zacqary left a comment

Choose a reason for hiding this comment

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

LGTM

@afgomez afgomez merged commit c00359e into elastic:master Jul 10, 2020
@afgomez afgomez deleted the 67683-limit-date-adjustments branch July 10, 2020 09:56
afgomez pushed a commit that referenced this pull request Jul 13, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 13, 2020
* master: (78 commits)
  Bump lodash package version (elastic#71392)
  refactor: 💡 use allow-list in AppArch codebase (elastic#71400)
  improve bugfix 7198 test stability (elastic#71250)
  [Security Solution][Ingest Manager][Endpoint] Optional ingest manager (elastic#71198)
  [Metrics UI] Round metric threshold time buckets to nearest unit (elastic#71172)
  [Security Solution][Endpoint] Policy creation callback fixes + Improved error handling in user manifest loop (elastic#71269)
  [Security Solution] Allow to configure Event Renderers settings (elastic#69693)
  Fix a11y keyboard overlay (elastic#71214)
  [APM] UI text updates (elastic#71333)
  [Logs UI] Limit `extendDatemath` to valid ranges (elastic#71113)
  [SIEM] fix tooltip of notes (elastic#71342)
  address index templates feedback (elastic#71353)
  Upgrade EUI to v26.3.1 (elastic#70243)
  [build] Creates Linux aarch64 archive (elastic#69165)
  [SIEM][Detection Engine] Fixes skipped tests (elastic#71347)
  [SIEM][Detection Engine][Lists] Adds read_privileges route for lists and list items
  [kbn/optimizer] implement "requiredBundles" property of KP plugins (elastic#70911)
  [Security Solution][Exceptions] - Exceptions modal pt 2 (elastic#70886)
  [ML] DF Analytics:  stop status polling when job stopped (elastic#71159)
  [SIEM][CASE] IBM Resilient Connector (elastic#66385)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] Exponential date range adjustments can go out of range, cause a loop of 500 errors
4 participants