package configmanager

import (
	"github.com/prometheus/client_golang/prometheus"
	k8smetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
)

var (
	// GuardCheckFail represents the result of Guard check.
	GuardCheckFail = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "infra",
			Subsystem: "cluster",
			Name:      "guard_check_fail",
			Help:      "A guard check fail. If the check fails, set the metrics value to 1; otherwise, set it to 0.",
		}, []string{"cluster_id", "guard"})
	UnexpectedConfigChange = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "infra",
			Subsystem: "cluster",
			Name:      "unexpected_config_change",
			Help:      "An unexpected config change captured. If the config change is unexpected, set the metrics value to 1; otherwise, set it to 0.",
		}, []string{"cluster_id", "component", "phase"})
)

func init() {
	k8smetrics.Registry.MustRegister(
		GuardCheckFail,
		UnexpectedConfigChange,
	)
}
