# Source: bosh-exporter
---

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/custom_rules?/-
  value:
    name: ConcourseCPUUtilisation
    rules:
      - record: "bosh_job:bosh_job_cpu:avg1h"
        expr: avg_over_time(bosh_job_load_avg01{bosh_job_name="concourse"}[1h])

      - &alert
        alert: ConcourseHighCPUUtilisation_Warning
        expr: "bosh_job:bosh_job_cpu:avg1h > 150"
        labels:
          severity: warning
          notify: email
        annotations:
          summary: "High cpu utilisation on {{ $labels.bosh_job_name }}/{{ $labels.bosh_job_index }}"
          description: "{{ $labels.bosh_job_name }}/{{ $labels.bosh_job_index }} CPU utilisation was over {{ $value | printf \"%.0f\" }}% in the last hour on average"

      - <<: *alert
        alert: ConcourseHighCPUUtilisation_Critical
        expr: "bosh_job:bosh_job_cpu:avg1h > 200"
        labels:
          severity: critical
          notify: email
        annotations:
          summary: "Critical cpu utilisation on {{ $labels.bosh_job_name }}/{{ $labels.bosh_job_index }}"
          description: "{{ $labels.bosh_job_name }}/{{ $labels.bosh_job_index }} CPU utilisation was over {{ $value | printf \"%.0f\" }}% in the last hour on average"

Migrate "Concourse load" monitor to Prometheus
Migrate "Concourse load" monitor to Prometheus

Original DataDog monitor:
${format("max(last_1m):max:system.load.1{bosh-job:concourse,deploy_env:%s} > 200
