prometheus中的record规则 – IPCPU-网络之路

groups:
  - name: record:cpu_load1
    rules:
    - record: record:node_load1
      expr: sum(node_load1)by(instance, Server, Module, APP, Leader) > count(node_cpu_seconds_total)by(instance, Server, Module, APP, Leader)/8 *2 and count(node_cpu_seconds_total)by(instance, Server, Module, APP, Leader)/8 < 4  or sum(node_load1)by(instance, Server, Module, APP, Leader) > count(node_cpu_seconds_total)by(instance, Server, Module, APP, Leader)/8 *1.5 and 4 <= count(node_cpu_seconds_total)by(instance, Server, Module, APP, Leader)/8 < 16  or sum(node_load1)by(instance, Server, Module, APP, Leader) > count(node_cpu_seconds_total)by(instance, Server, Module, APP, Leader)/8 *0.8 and 16 <= count(node_cpu_seconds_total)by(instance, Server, Module, APP, Leader)/8


  - alert: node_cpu_load
    expr: record:node_load1{instance!~"172.25.155.16(1|2|3|4)|172.25.135.(231|232|233|234|235|236|243|246|245|247|248|252|250|242|244)|172.25.155.(151|152|161|162|163|164)"}
    for: 1m
    labels: 
      severity: warning
      class1: DEVICE
      class2: SERVER
      class3: PERFORMANCE
    annotations:
      summary: "Process"
      description: "Processor load is too high ( current value is : {{$value}} )"
      vlauetag: '{{ $value }}'