diff --git a/jsonnetfile.lock.json b/jsonnetfile.lock.json index 31be1245fe..66da677b55 100644 --- a/jsonnetfile.lock.json +++ b/jsonnetfile.lock.json @@ -293,8 +293,8 @@ "subdir": "jsonnet/telemeter" } }, - "version": "a9417a6062c3a31ed78c06ea3a0613a52f2029b2", - "sum": "IFJkQRq4+QFi0/7Rc5OVdqyV6KXNXeBp8hyFAcdEna8=" + "version": "0453f452b7ca677e3be10faa95bea714733b4830", + "sum": "0m1kvO0SH4YoldGek69nhBGMTPxYz3gYcyNhfrymAOE=" }, { "source": { diff --git a/resources/services/observatorium-metrics-template.yaml b/resources/services/observatorium-metrics-template.yaml index 7dad8cd48b..ec4b40a09b 100644 --- a/resources/services/observatorium-metrics-template.yaml +++ b/resources/services/observatorium-metrics-template.yaml @@ -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": @@ -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: