Skip to content

Commit

Permalink
Update telemeter and regenerate rules (#699)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipgough authored Oct 16, 2024
1 parent 0262e4d commit 0a6afee
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@
"subdir": "jsonnet/telemeter"
}
},
"version": "a9417a6062c3a31ed78c06ea3a0613a52f2029b2",
"sum": "IFJkQRq4+QFi0/7Rc5OVdqyV6KXNXeBp8hyFAcdEna8="
"version": "0453f452b7ca677e3be10faa95bea714733b4830",
"sum": "0m1kvO0SH4YoldGek69nhBGMTPxYz3gYcyNhfrymAOE="
},
{
"source": {
Expand Down
30 changes: 30 additions & 0 deletions resources/services/observatorium-metrics-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2027,6 +2027,11 @@ objects:
- "interval": "4m"
"name": "telemeter-telemeter.rules"
"rules":
- "expr": |
count_over_time(vector(1)[1h:5m])
"labels":
"tenant_id": "FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"
"record": "steps:count1h"
- "expr": |
count by (name,reason) (cluster_operator_conditions{condition="Degraded"} == 1)
"labels":
Expand Down Expand Up @@ -2157,6 +2162,31 @@ objects:
"labels":
"tenant_id": "FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"
"record": "cluster:capacity_effective_cpu_cores"
- "expr": |
# self managed OpenShift cluster
max by (_id, managed_cluster_id) (acm_managed_cluster_info{product="OpenShift"}) * on(managed_cluster_id) group_left() (
# On one side, the acm_managed_cluster_info metric has the managed_cluster_id label identifiying the managed cluster and the _id label identifying the hub cluster.
# On the other side, the cluster:capacity_effective_cpu_cores metric has the _id label which identifying the managed cluster.
# To join the 2 metrics, we need to add a managed_cluster_id label with the same value as _id to the cluster:capacity_effective_cpu_cores metric.
label_replace(
max by(_id) (cluster:capacity_effective_cpu_cores), "managed_cluster_id", "$1", "_id", "(.*)"
)
) * 2 or
# managed OpenShift cluster and non-OpenShift clusters
max by (_id, managed_cluster_id) (acm_managed_cluster_worker_cores:max)
"labels":
"tenant_id": "FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"
"record": "acm_capacity_effective_cpu_cores"
- "expr": |
max by(_id)(sum_over_time(hostedcluster:hypershift_cluster_vcpus:max[1h:5m])) / scalar(count_over_time(vector(1)[1h:5m]))
"labels":
"tenant_id": "FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"
"record": "hostedcluster:hypershift_cluster_vcpus:vcpu_hours"
- "expr": |
hostedcluster:hypershift_cluster_vcpus:vcpu_hours or on (_id) cluster:usage:workload:capacity_virtual_cpu_hours
"labels":
"tenant_id": "FB870BF3-9F3A-44FF-9BF7-D7A047A52F43"
"record": "rosa:cluster:vcpu_hours"
kind: ConfigMap
metadata:
annotations:
Expand Down

0 comments on commit 0a6afee

Please sign in to comment.