|
| 1 | +groups: |
| 2 | + # Base metrics — local: prefix means they stay inside the TEE |
| 3 | + # (remote_write only forwards flashbox:*) |
| 4 | + - name: local_container_metrics |
| 5 | + interval: 30s |
| 6 | + rules: |
| 7 | + # Percent of total machine CPU capacity (normalized by core count, so the |
| 8 | + # 0-100 scale holds regardless of how many vCPUs the VM has). |
| 9 | + - record: local:container_cpu_percent |
| 10 | + expr: > |
| 11 | + sum(rate(namedprocess_namegroup_cpu_seconds_total{groupname="searcher-container"}[5m])) * 100 |
| 12 | + / count(node_cpu_seconds_total{mode="idle"}) |
| 13 | +
|
| 14 | + # Forwarded metrics — flashbox: prefix, picked up by remote_write |
| 15 | + - name: flashbox_health |
| 16 | + interval: 30s |
| 17 | + rules: |
| 18 | + # 1 if at least one process is running in the searcher-container group, |
| 19 | + # absent if process-exporter isn't reporting it. |
| 20 | + - record: flashbox:container_alive |
| 21 | + expr: namedprocess_namegroup_num_procs{groupname="searcher-container"} > bool 0 |
| 22 | + |
| 23 | + # Spike-guarded: current 15m avg must be under 80%, |
| 24 | + # AND the 10m max ending 5m ago must have been under 70% |
| 25 | + - record: flashbox:container_average_cpu_is_under_80_percent |
| 26 | + expr: > |
| 27 | + (avg_over_time(local:container_cpu_percent[15m]) < bool 80) |
| 28 | + * (max_over_time(local:container_cpu_percent[10m] offset 5m) < bool 70) |
| 29 | +
|
| 30 | + - record: flashbox:container_oom_kills_count |
| 31 | + expr: node_vmstat_oom_kill |
| 32 | + |
| 33 | + - record: flashbox:disk_free_space_is_over_10_percent |
| 34 | + expr: > |
| 35 | + (node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"}) > bool 0.1 |
| 36 | +
|
| 37 | + - record: flashbox:disk_free_space_is_over_128_gb |
| 38 | + expr: > |
| 39 | + (node_filesystem_avail_bytes{mountpoint="/persistent"}) > bool (128 * 1024 * 1024 * 1024) |
| 40 | +
|
| 41 | + - record: flashbox:network_is_up |
| 42 | + expr: > |
| 43 | + (sum(rate(node_network_receive_bytes_total{device!~"lo"}[5m])) |
| 44 | + + sum(rate(node_network_transmit_bytes_total{device!~"lo"}[5m]))) |
| 45 | + > bool 0 |
0 commit comments