package gitopsv2

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

const (
	namespace = "gitops"
	subsystem = "config"
)

var (
	ConfigDryrunAffected = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "dryrun_affected",
			Help:      "Status of Components that might be affected due to accumulation of previous dryrun changes",
		}, []string{"cluster_id", "component", "reason"})

	ConfigRevisionRefIsNil = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespace,
			Subsystem: subsystem,
			Name:      "revision_ref_is_nil",
			Help:      "RevisionRef is nil in the Infra Cluster CRD",
		}, []string{"cluster_id"})
)

func init() {
	metrics.Registry.MustRegister(ConfigDryrunAffected)
	metrics.Registry.MustRegister(ConfigRevisionRefIsNil)
}
