groups:
  - name: next-gen.export
    rules:
      - alert: NextGenGlobalExportRunning30min
        annotations:
          message: "Nextgen-global export running > 30min. cluster_id={{ $labels.cluster_id }} export_id={{ $labels.export_id }}"
        expr: |
          max by (cluster_id, export_id) (
            export_running_duration_seconds
          ) > 1800
        for: 3m
        labels:
          severity: major
          response_class: ticket
          tier: next-gen
          component: next-gen-export
          oncall_team: tidb_x_tools

      - alert: NextGenGlobalExportFailed
        annotations:
          message: "Nextgen-global export failed. cluster_id={{ $labels.cluster_id }}, export_id={{ $labels.export_id }}."
        expr: sum(increase(export_terminal_state_total{state="failed"}[5m])) by (cluster_id, export_id) > 0
        labels:
          severity: major
          response_class: ticket
          tier: next-gen
          component: next-gen-export
          oncall_team: tidb_x_tools