Load Detection Rules¶
Load detection rules live in automated-rules/load-level/ and define how cluster load is classified as:
- low
- medium
- high
This load level is then used by normal rules that define load_level_thresholds.
Example¶
rule_type = "load_detection"
display_name = "cluster_volume"
[[metrics]]
name = "containers"
source = "rox_sensor_num_containers_in_clusterentities_store"
weight = 1.0
[[metrics]]
name = "pods"
source = "rox_sensor_num_pods_in_store"
weight = 0.5
[[thresholds]]
level = "low"
max_value = 100
[[thresholds]]
level = "medium"
min_value = 100
max_value = 500
[[thresholds]]
level = "high"
min_value = 500
Worked Example (Step by Step)¶
Assume the current metrics are:
rox_sensor_num_containers_in_clusterentities_store 240
rox_sensor_num_pods_in_store 120
Using the weights from the rule:
containersweight =1.0podsweight =0.5
Now compute:
weighted_sum = (240 * 1.0) + (120 * 0.5) = 240 + 60 = 300total_weight = 1.0 + 0.5 = 1.5normalized_value = weighted_sum / total_weight = 300 / 1.5 = 200
Compare normalized_value = 200 to thresholds:
low:< 100medium:>= 100and< 500high:>= 500
Result: medium load level.
How Score Calculation Works¶
The detector computes:
weighted_sum = Σ(metric_value * weight)total_weight = Σ(weight)normalized_value = weighted_sum / total_weight- Match
normalized_valueagainst threshold ranges
Practical Guidance¶
- Start with 1-3 metrics that represent cluster size/pressure.
- Use larger weights for more trusted indicators.
- Keep thresholds simple first, then tune from production observations.
- Re-test normal rules after load detection changes, because rule statuses may shift with new load levels.