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

fix(slo): history details data #183097

Merged
merged 14 commits into from
May 16, 2024
Merged

fix(slo): history details data #183097

merged 14 commits into from
May 16, 2024

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented May 9, 2024

Resolves #182251

🌮 Summary

This PR fixes the calculation of the historical summary data when an ad-hoc date range is provided. Indeed, when querying the SLI data for a rolling SLO with a provided date range, we need to query since the start of the range minus the slo rolling window duration. Otherwise the cumulative sum is not correct.

One way to see it is that when we zoom into the chart, the values should not change (when keeping the same bucket sizes, i.e when the range duration is in the same order of magnitude than the time window duration)

I'm also cleaning up the range type, by keeping only one common type, e.g. using Date type. I think that string or number for representing dates are dangerous, and difficult to follow in a codebase.

I also need to go back to the historical summary client and clean up the DateRange i've introduced to fix the issue aforementioned issue. it's not very clean, and pretty confusing at the moment. So far, I only came up with a comment. Any suggestion for improving this part of the code, getDateRange()?

I've used this to validate the tests: https://docs.google.com/spreadsheets/d/1uDoqq4sJPt2Dnksc1U2x6zAfQB73SK2udvweLl6ODuo/edit#gid=908013864

How to test

  • Run data forge for 2 weeks: node x-pack/scripts/data_forge.js --events-per-cycle 50 --lookback now-14d --dataset fake_stack --install-kibana-assets --kibana-url http://localhost:5601/kibana
  • Go get a coffee, it will take time
  • Create an SLO over 7days rolling window (either Timeslices or Occurrences)
  • When going to the history page without changing the time picker value, the historical charts should be the same than the overview page (look at the beginning of the chart)
  • When zooming in with a date range > 3days (to keep the same bucket size interval for the calculations), any value should be equal to the previously shown value for the same date.
historical.slo.page.mov

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@kdelemme kdelemme added release_note:fix Team:obs-ux-management Observability Management User Experience Team v8.15.0 labels May 9, 2024
@kdelemme
Copy link
Contributor Author

/ci

@kdelemme kdelemme marked this pull request as ready for review May 13, 2024 16:47
@kdelemme kdelemme requested a review from a team as a code owner May 13, 2024 16:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label May 13, 2024
Comment on lines +223 to +227
.filter(
(bucket) =>
moment(bucket.key_as_string).isSameOrAfter(dateRange.range.from) &&
moment(bucket.key_as_string).isSameOrBefore(dateRange.range.to)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please explain why this post-filtering is required?

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

LGTM , works as expected now , even for smaller ranges !!

@kibana-ci
Copy link
Collaborator

kibana-ci commented May 16, 2024

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
slo 869.7KB 869.3KB -416.0B

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5405 +5405
total size - 8.8MB +8.8MB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observability 151.5KB 151.4KB -93.0B

History

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

@kdelemme kdelemme merged commit 2e9f1ba into elastic:main May 16, 2024
21 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:fix Team:obs-ux-management Observability Management User Experience Team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] historical charts in the history tab are wrong
6 participants