groups:
  - name: pounce.ops
    rules:
      - alert: PounceHigh5xxRate
        expr: |
          (
            sum(rate(http_requests_total{status=~"5.."}[5m]))
            /
            clamp_min(sum(rate(http_requests_total[5m])), 1)
          ) > 0.02
        for: 10m
        labels:
          severity: page
        annotations:
          summary: "pounce API is returning elevated 5xx"
          description: "More than 2% of requests are 5xx for 10 minutes."

      - alert: PounceBackupMissing
        expr: |
          (pounce_db_backups_enabled == 1)
          and (pounce_db_backup_latest_age_seconds > 93600)
        for: 30m
        labels:
          severity: page
        annotations:
          summary: "pounce DB backup is stale"
          description: "No successful DB backup file in the last ~26 hours while backups are enabled."

  - name: pounce.business
    rules:
      - alert: PounceDealInquiriesZero24h
        expr: pounce_deal_inquiries_created{window_days="1"} == 0
        for: 6h
        labels:
          severity: warn
        annotations:
          summary: "No inquiries created in last 24h"
          description: "Deal funnel might be broken or traffic dropped to zero."

      - alert: PounceYieldClicksZero24h
        expr: pounce_yield_clicks{window_days="1"} == 0
        for: 12h
        labels:
          severity: warn
        annotations:
          summary: "No yield clicks in last 24h"
          description: "Yield routing might be misconfigured or traffic is absent."
