Skip to content

Commit

Permalink
refactor: break subquery into recording rule
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Gough <[email protected]>
  • Loading branch information
philipgough committed May 13, 2024
1 parent 1b404c1 commit 6416061
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions contrib/prometheus/recording-rules-resource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ objects:
spec:
groups:
- name: host-metering
interval: 30m
interval: 10m
limit: 0
rules:
- record: host:usage:workload:cpu_hours1h
expr: max by(_id) (sum_over_time(system_cpu_logical_count[1h:10m])) / scalar(count_over_time(vector(1)[1h:10m]))
- record: min_system_cpu_logical_count:10m
expr: |
min_over_time(
system_cpu_logical_count{
product=~".*(^|,)(204)($|,).*",
billing_model="marketplace",
support=~"Premium|Standard|Self-Support|None|"
}[10m]
)
labels:
rulesVersion: v0

0 comments on commit 6416061

Please sign in to comment.