elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.32k stars 7.97k forks source link

feat(slo): Consider empty slice as good slice for sli calculation purposes on timeslice budgeting method #181888

Closed kdelemme closed 1 week ago

kdelemme commented 1 week ago

Resolves https://github.com/elastic/kibana/issues/181577

🏎️ Summary

We used to calculate the SLI value of Timeslices SLOs based on the observed good and total events. The good events was the sum of isGoodSlice, while the total events was the value_count of isGoodSlice. When there is no data, the rollup documents are not created, and therefore the good and total values are not taking these slices into account.

This PR changes this behaviour. For a Timeslices SLO, we always use the total slices available in the time window, e.g. 10080 for a 7d rolling or weekly calendar aligned. And we compute the SLI as 1 - (total - good) / total_slices. We do this change in the different services that fetch the SLI rollup documents in order to calculate the SLI value. And also in the summary transform for Timeslices SLO.

Scenario Good Events (observed) Total Events (observed) Bad Events (observed) Total Slices In Period SLI (old) SLI (new)
7d rolling, 1m slice, no missing data 10000 10080 80 10080 0.99206349 0.99206349
7d rolling, 60m slice, no missing data 158 168 10 168 0.94047619 0.94047619
7d rolling, 1m slice, missing data 100 120 20 10080 0.83333333 0.99801587

Release note

Timeslice SLOs calculation for the sli value changed to include the no data slices as good slice. For existing "Timeslice" SLOs you will need to use the POST /api/observability/slos/{slo.id}/_reset endpoint to reset the transforms to take advantage of the new calculation.

apmmachine commented 1 week ago

:robot: GitHub comments

Expand to view the GitHub comments

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

elasticmachine commented 1 week ago

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

kibana-ci commented 1 week ago

:yellow_heart: Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/slo-schema 179 178 -1

Async chunks

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

id before after diff
slo 726.3KB 726.3KB -57.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 - 5871 +5871
total size - 6.7MB +6.7MB

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.1KB 151.1KB -60.0B
Unknown metric groups #### API count | id | [before](https://github.com/elastic/kibana/commit/e6dcdc7b0380f5b3fe27145f516974fcf713470e) | [after](https://github.com/elastic/kibana/commit/05e2c25b653bdba0e583a6694e830743d66de84c) | diff | | --- | --- | --- | --- | | `@kbn/slo-schema` | 179 | 178 | -1 |

History

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

kdelemme commented 6 days ago

💚 All backports created successfully

Status Branch Result
8.14

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation