slok / sloth

🦥 Easy and simple Prometheus SLO (service level objectives) generator
https://sloth.dev
Apache License 2.0
2.09k stars 173 forks source link

Question: how to use multiple error budget windows? #488

Open r3code opened 1 year ago

r3code commented 1 year ago

Is it possible to use different error budget windows for SLOs?

For example my first service needs 7 day window and the second one 28 days.

For me it looks like I should have two sets of sloth specs and build them as

    # 7 day budget
    sloth generate --input="services/shop/widget_get.slo.yml" --default-slo-period=7d --slo-period-windows-path=./windows 
    sloth generate --input="services/shop/cart_add.slo.yml" --default-slo-period=7d --slo-period-windows-path=./windows 
    # 28 days budget
    sloth generate --input="services/parcel/prediction_get.slo.yml" --default-slo-period=28d --slo-period-windows-path=./windows 

And we can not have one SLO in two windows as alerts do not differentiated by a window. So sloth It generates an alert spec with the same alert name but with a different formula according to the window. We can't merge them.

jkutes commented 1 year ago

I'm as well very interested in solution for this,