Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Add downtime recording rules for moving time windows
Browse files Browse the repository at this point in the history
Co-authored-by: Wesley Bermbach <[email protected]>
Co-authored-by: Istvan Zoltan Ballok <[email protected]>
  • Loading branch information
istvanballok and wyb1 committed May 11, 2022
1 parent f4bfb9a commit a5ddcb5
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions charts/connectivity-exporter/rules/error-budget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ groups:
- record: downtime
labels:
kind: anchored
in: hour
expr: |
sum without(hour) (
Expand All @@ -99,6 +100,7 @@ groups:
- record: downtime
labels:
kind: anchored
in: day
expr: |
sum without(day) (
Expand All @@ -108,6 +110,7 @@ groups:
- record: downtime
labels:
kind: anchored
in: week
expr: |
sum without(week) (
Expand All @@ -117,6 +120,7 @@ groups:
- record: downtime
labels:
kind: anchored
in: calendarmonth
expr: |
sum without(year, month) (
Expand All @@ -128,6 +132,82 @@ groups:
(service:sli_seconds:total{year!="", month!=""})
))
- record: service:sli_seconds:moving:total
expr: |
service:sli_seconds
+
(
max_over_time(
service:sli_seconds:moving:total[10m]
)
or
service:sli_seconds * 0
)
- record: downtime
labels:
kind: moving
in: hour
expr: |
(
service:sli_seconds:moving:total
-
(
service:sli_seconds:moving:total offset 1h
or
service:sli_seconds:moving:total * 0
)
)
/ 60 / 60
- record: downtime
labels:
kind: moving
in: day
expr: |
(
service:sli_seconds:moving:total
-
(
service:sli_seconds:moving:total offset 1d
or
service:sli_seconds:moving:total * 0
)
)
/ 60 / 60 / 24
- record: downtime
labels:
kind: moving
in: week
expr: |
(
service:sli_seconds:moving:total
-
(
service:sli_seconds:moving:total offset 1w
or
service:sli_seconds:moving:total * 0
)
)
/ 60 / 60 / 24 / 7
- record: downtime
labels:
kind: moving
in: four_weeks
expr: |
(
service:sli_seconds:moving:total
-
(
service:sli_seconds:moving:total offset 4w
or
service:sli_seconds:moving:total * 0
)
)
/ 60 / 60 / 24 / 7 / 4
- record: downtime:in
expr: count by (in) (downtime) * 0

Expand Down

0 comments on commit a5ddcb5

Please sign in to comment.