Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions internal/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,10 @@ func parseConfigMap(configMap *v1.ConfigMap) (parsed *Config, err error) {

func setKotaryMetrics(kotaryConfig *Config) {

MaxJobsLimitNSGauge.Set(float64(kotaryConfig.MaxJobsLimitNS))
MaxJobsLimitClusterGauge.Set(float64(kotaryConfig.MaxJobsLimitCluster))
RatioMaxAllocationCPUGauge.Set(float64(kotaryConfig.RatioMaxAllocationCPU))
RatioMaxAllocationMemoryGauge.Set(float64(kotaryConfig.RatioMaxAllocationMemory))
RatioOverCommitCPUGauge.Set(float64(kotaryConfig.RatioOverCommitCPU))
RatioOverCommitMemoryGauge.Set(float64(kotaryConfig.RatioOverCommitMemory))

klog.Infof("Kotary metrics updated from configuration")
}

28 changes: 9 additions & 19 deletions internal/utils/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,22 @@ var DefaultClaimCounter = promauto.NewCounterVec(prometheus.CounterOpts{
Help: "Number of default claims created",
}, []string{"status"})

var MaxJobsLimitNSGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "kotary_max_jobs_batch_limit_ns",
Help: "Maximum number of jobs allowed per namespace",
})

var MaxJobsLimitClusterGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "kotary_max_jobs_batch_limit_cluster",
Help: "Maximum total number of jobs allowed across the cluster",
})

var RatioMaxAllocationCPUGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "kotary_ratio_max_allocation_cpu",
Help: "Maximum CPU allocation ratio allowed per namespace compared to total cluster CPU",
Name: "kotary_ratio_max_allocation_cpu",
Help: "Maximum CPU allocation ratio allowed per namespace compared to total cluster CPU",
})

var RatioMaxAllocationMemoryGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "kotary_ratio_max_allocation_memory",
Help: "Maximum memory allocation ratio allowed per namespace compared to total cluster memory",
Name: "kotary_ratio_max_allocation_memory",
Help: "Maximum memory allocation ratio allowed per namespace compared to total cluster memory",
})

var RatioOverCommitCPUGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "kotary_ratio_over_commit_cpu",
Help: "CPU over-commit ratio applied to node available resources (percentage)",
Name: "kotary_ratio_over_commit_cpu",
Help: "CPU over-commit ratio applied to node available resources (percentage)",
})

var RatioOverCommitMemoryGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "kotary_ratio_over_commit_memory",
Help: "Memory over-commit ratio applied to node available resources (percentage)",
})
Name: "kotary_ratio_over_commit_memory",
Help: "Memory over-commit ratio applied to node available resources (percentage)",
})
Loading