groups:
  - name: PauseFatal
    rules:
      - alert: PauseFatal
        expr: vitam_processing_workflow_operation_total{status="FATAL",state="PAUSE"} == 1
        for: 10m
        labels:
          severity: warning
        annotations:
          summary: "One {{ $labels.workflow }} operation is in PAUSE/FATAL state"
          description: "One operation from workflow {{ $labels.workflow }} is in PAUSE/FATAL state for more than 10 minutes."

      - alert: MultiplePauseFatal
        expr: sum(vitam_processing_workflow_operation_total{status="FATAL",state="PAUSE"}) > 1
        for: 10m
        labels:
          severity: critical
        annotations:
          summary: "{{ $value }} operations are in PAUSE/FATAL state"
          description: |
            Multiple workflows are in PAUSE/FATAL state for more than 10 minutes.

            Details of affected workflows:
            {{ range query "vitam_processing_workflow_operation_total{status='FATAL',state='PAUSE'}" }}
            - Workflow: {{ .Labels.workflow }}, Count: {{ .Value }}
            {{ end }}
