Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kévin PEREZ committed Feb 6, 2024
1 parent 451bdea commit d11932c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions internal/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"strings"

"github.com/prometheus/client_golang/prometheus"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/client-go/kubernetes"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -171,6 +172,24 @@ func parseConfigMap(configMap *v1.ConfigMap) (parsed *Config, err error) {

klog.Infof("Loaded config map : %+v\n", parsed)

generateMetricsFromConfigmap(parsed)

return

}

func generateMetricsFromConfigmap(parsed *Config) (err error) {

var (
kotaryRatioOvercommitMemory = prometheus.NewGauge(
prometheus.GaugeOpts{
Name: "kotary_ratio_overcommit_memory",
Help: "The ratioOverCommitMemory defined in the configmap",
},
)
)

kotaryRatioOvercommitMemory.Set(parsed.RatioOverCommitMemory)
prometheus.MustRegister(kotaryRatioOvercommitMemory)
return
}

0 comments on commit d11932c

Please sign in to comment.