package constants

const Group = "observability.pingcap.com"

var (
	LabelClusterID           = Group + "/cluster-id"
	LabelVendor              = Group + "/vendor"
	LabelRegion              = Group + "/region"
	LabelTenantID            = Group + "/tenantID"
	LabelProjectID           = Group + "/projectID"
	LabelApplicationID       = Group + "/applicationID"
	LabelO11yID              = Group + "/o11yID"
	LabelBizType             = Group + "/bizType"
	LabelAZ                  = Group + "/az"
	LabelAlias               = Group + "/alias"
	LabelTemplateID          = Group + "/rule-templateID"
	LabelShareMode           = Group + "/share-mode"
	LabelTimestampToDelete   = Group + "/timestamp-to-delete"
	LabelTimestampToPause    = Group + "/timestamp-to-pause"
	LabelMultiTenancyRule    = Group + "/rule-multi-tenancy"
	LabelClusterPaused       = Group + "/cluster-paused"
	LabelVMAccountID         = Group + "/vm-accountID"
	LabelVMProjectID         = Group + "/vm-projectID"
	LabelParentClusterID     = Group + "/parent-clusterID"
	LabelNextGen             = Group + "/next-gen"
	LabelTopSQLID            = Group + "/topsql-id"
	LabelKeyVisualizerID     = Group + "/key-visualizer-id"
	LabelSlowQueryID         = Group + "/slow-query-id"
	LabelProfilingID         = Group + "/profiling-id"
	LabelIntegrationTaskID   = Group + "/integration-task-id"
	LabelIntegrationTaskType = Group + "/data-type"
	LabelAliyunInjection     = "pod-identity.alibabacloud.com/injection"
	LabelComponent           = Group + "/component"
	LabelInternal            = Group + "/internal"
	LabelUserID              = Group + "/userID"
)

var (
	AnnotationNote               = Group + "/note"
	AnnotationVersion            = Group + "/version"
	AnnotationTags               = Group + "/tags"
	AnnotationShareMode          = Group + "/share-mode"
	AnnotationMonitorSpec        = Group + "/monitor-spec"
	AnnotationMonitorEndPoint    = Group + "/monitor-endpoint"
	AnnotationDataPropertyRights = Group + "/data-property-rights"
	AnnotationNewDataSnapshot    = Group + "/new-data-snapshot"

	// AnnotationProxyClusterID means pushing the metrics of this cluster to another proxy cluster
	// now used for pushing k8s-infra metrics to seed cluster
	AnnotationProxyClusterID = Group + "/proxy-cluster-id"

	AnnotationAgentUser = Group + "/agent-user"

	AnnotationServiceAccount             = Group + "/service-account"
	AnnotationObjectStorageBucket        = Group + "/storage-bucket"
	AnnotationObjectStorageMetricsPrefix = Group + "/storage-prefix"
	AnnotationObjectStorageEndpoint      = Group + "/storage-endpoint"
	AnnotationBlobStorageAccount         = Group + "/blob-storage-account"

	AnnotationLastScaleTime           = Group + "/last-scale-time"
	AnnotationLastScaleStorage        = Group + "/last-scale-time-storage"
	AnnotationAgentServiceAccountRole = Group + "/agent-service-account-role"
	AnnotationAgentAssumeRole         = Group + "/agent-assume-role"
	AnnotationLastObservedTime        = Group + "/last-observed-time"

	AnnotationIntegrationTaskDisplayName = Group + "/displayName"

	AnnotationBYOCVPCPeeringID     = Group + "/byoc-vpc-peering-id"
	AnnotationBYOCDataplaneVPCCIDR = Group + "/byoc-dataplane-vpc-cidr"
)

var (
	RuleLabelTenantID      = "tenantid"
	RuleLabelApplicationID = "projectid"
	RuleLabelNameSpace     = "namespace"
	RuleLabelAlertType     = "alerttype"
)

var (
	RuleLabelStatus        = "status"
	RuleLabelUserModified  = "userModified"
	RuleLabelCanEdit       = "canEdit"
	RuleLabelID            = "ruleID"
	RuleLabelSeverity      = "severity"
	RuleLabelVisibility    = "visibility"
	RuleLabelMonitortarget = "monitorTarget"
	RuleLabelOperator      = "operator"
	RuleLabelDefaultFor    = "defaultFor"
	RuleLabelDefaultExpr   = "defaultExpr"
)

var (
	RuleAnnotationsMessage     = "message"
	RuleAnnotationsDescription = "description"
	RuleAnnotationsSummary     = "summary"
)

var LabelAzureUseWorkloadIdentity = "azure.workload.identity/use"

// External Labels used by prometheus & vmalert
const (
	ExternalLabelBizType = "o11y_biz_type"
	// ExternalLabelRegion in the format of <vendor>-<region>
	ExternalLabelRegion        = "o11y_region"
	ExternalLabelTenantID      = "o11y_tenant_id"
	ExternalLabelProjectID     = "o11y_project_id"
	ExternalLabelO11yID        = "o11y_id"
	ExternalLabelApplicationID = "o11y_application_id"
	ExternalLabelTiDBClusterID = "tidb_cluster_id"
	ExternalLabelOverlay       = Group + "/o11y-overlay"
)

const (
	AnnotationServiceAccountRole      = "eks.amazonaws.com/role-arn"
	AnnotationServiceAccountRoleGCP   = "iam.gke.io/gcp-service-account"
	AnnotationServiceAccountRoleAzure = "azure.workload.identity/client-id"
)

const (
	StorageBucketNameTemplate     = "o11y-%s-%s-%s"
	ExternalStorageBucketNameTmpl = "o11y-external-%s-%s-%s"
	UserTaskBucketNameTmpl        = "o11y-task-%s"

	DefaultBucketGroup = "shared"

	StorageDataPrefixTemplate = "%d/%s/%s/%s/%s/"

	AgentRoleNameTemplate      = "o11y-agent-%s-%s-%s-%s"
	AgentRoleNameAliasTemplate = "o11yA-%s"

	AgentDataplaneRoleNameTemplate = "o11y-agent-data-%s-%s-%s-%s"
	// fmt.Printf(AWSAgentDataplaneRoleNameTemplate, env, biztype, tenantId, region, account)
	AWSAgentDataplaneRoleNameTemplate   = "o11y-agent-data-%s-%s-%s-%s-%s"
	AzureAgentDataplaneRoleNameTemplate = "o11y-agent-data-%s-%s-%s-%s-%s"
	AgentDataplaneRoleNameAliasTemplate = "o11yAD-%s"
	IntegrationTaskRoleNameTemplate     = "o11y-ext-%s"

	NamespaceTemplate                   = "%s-%s"
	GCPTiDBClusterVectorSAKeyTemplate   = "tidb%s/o11y-vector-agent"
	GCPK8sTiDBClusterVectorSAKey        = "monitoring/o11y-vector"
	AzureK8sTiDBClusterVectorSAKey      = "monitoring:o11y-vector"
	AzureTiDBClusterVectorSAKeyTemplate = "tidb%s:o11y-vector-agent"

	ApplicationIDK8sInfra   = "k8s-infra"
	ApplicationIDSeed       = "seed"
	ApplicationIDBase       = "base"
	ApplicationIDServerless = "devtier-infra"
)

const DataAccountSegmentConfigMap = "data-account-segment"
const DataAccountKeyStartID = "data-account-key-start-id"
const AlertRuleTemplateNamespace = "default"
const VMRuleGroupDefaultConcurrency = 10
