# Source: bosh-exporter
---

- type: replace
  path: /instance_groups/name=prometheus2/jobs/name=prometheus2/properties/prometheus/custom_rules?/-
  value:
    name: BoshDuplicateReleases
    rules:
      - alert: BoshDuplicateReleases_Warning
        expr: |
          count by (bosh_release_name) (
            count by (bosh_release_name, bosh_release_version) (bosh_deployment_release_info{bosh_release_name!="bpm"})
          ) > 1
        labels:
          severity: warning
        for: 2h
        annotations:
          summary: "Duplicate bosh release of {{ $labels.bosh_release_name }}"
          description: "There are {{ $value }} versions of {{ $labels.bosh_release_name }} and we should probably only have one"

Add check for no duplicate bosh releases
Add check for no duplicate bosh releases

This adds a check for no duplicate bosh releases (except for bpm as it
is likely we will have multiple releases of bpm).

We do not want multiple releases because we should ideally be running
the same version of everything.

Signed-off-by: Toby Lorne <527052641d65eef236eeef9545b2acac74c35d57@digital.cabinet-office.gov.uk>
