package serverless

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

const (
	subsystem = "serverless_controller"
)

var (
	// VMRuleMapErrorCounter counts errors when mapping VMRule events to Cluster reconcile requests.
	// This helps alert operators when update events may be lost due to RDS client failures.
	VMRuleMapErrorCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
		Subsystem: subsystem,
		Name:      "vmrule_map_error_total",
		Help:      "Total number of errors when mapping VMRule events to Cluster reconcile requests",
	}, []string{"vmrule", "error_type"})
)

func init() {
	ctrlmetrics.Registry.MustRegister(VMRuleMapErrorCounter)
}
