package premiumdm

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

const (
	ns        = "dataflow"
	subsystem = "premium_dm"

	TenantLabel    = "tenant"
	ClusterIDLabel = "cluster_id"
)

var commonIDLabels = []string{TenantLabel, ClusterIDLabel}

var (
	PremiumDMTaskStatusCount = prometheus.NewDesc(
		prometheus.BuildFQName(ns, subsystem, "task_status_count"),
		"Current premium DM task count grouped by tenant, cluster, and stage.",
		append(commonIDLabels, "stage"),
		nil,
	)

	PremiumDMTaskStageDurationSeconds = prometheus.NewDesc(
		prometheus.BuildFQName(ns, subsystem, "task_stage_duration_seconds"),
		"How long a premium DM task has stayed in its current stage, "+
			"approximated by updated_at and falling back to created_at.",
		[]string{TenantLabel, ClusterIDLabel, "task_id", "stage"},
		nil,
	)

	PremiumDMRecentFail = prometheus.NewDesc(
		prometheus.BuildFQName(ns, subsystem, "recent_fail"),
		"Recent failed premium DM tasks within a lookback window.",
		[]string{TenantLabel, ClusterIDLabel, "task_id", "stage"},
		nil,
	)
)
