package metrics

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

const BranchComponent = "branch"

var (
	BranchRestoreHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: BranchComponent,
			Name:      "restore_seconds",
			Help:      "Histogram of branch restore",
			Buckets:   append(prometheus.DefBuckets, []float64{20, 50, 100, 200}...),
		},
		[]string{"cluster_id", "project_id", "tenant_id"},
	)
)

func init() {
	// Register custom metrics with the global prometheus registry
	metrics.Registry.MustRegister(BranchRestoreHistogram)
}
