package metric

import (
	"github.com/prometheus/client_golang/prometheus"

	"github.com/tidbcloud/tidb-management-service/utilities/workflow"
)

var (
	// NextGenFinalBackupFailuresTotal counts terminal final-backup failures that
	// intentionally do not block overdue cluster cleanup.
	// Alert example: increase(workflow_nextgen_final_backup_failures_total[10m]) > 0.
	NextGenFinalBackupFailuresTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: workflow.NS,
			Name:      "nextgen_final_backup_failures_total",
			Help:      "Number of unsuccessful Nextgen final backups that did not block overdue cluster cleanup.",
		},
		[]string{"backup_state"},
	)
)

func init() {
	prometheus.MustRegister(NextGenFinalBackupFailuresTotal)
}
