mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 17:57:51 +00:00
dependency-injected non-global metrics object
This commit is contained in:
parent
b394496f5c
commit
bda754ad2d
7 changed files with 162 additions and 78 deletions
|
|
@ -5,8 +5,6 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/directxman12/k8s-prometheus-adapter/pkg/metrics"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
|
|
@ -30,7 +28,5 @@ func FromYAML(contents []byte) (*MetricsDiscoveryConfig, error) {
|
|||
if err := yaml.UnmarshalStrict(contents, &cfg); err != nil {
|
||||
return nil, fmt.Errorf("unable to parse metrics discovery config: %v", err)
|
||||
}
|
||||
metrics.Rules.WithLabelValues("normal").Set(float64(len(cfg.Rules)))
|
||||
metrics.Rules.WithLabelValues("external").Set(float64(len(cfg.ExternalRules)))
|
||||
return &cfg, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue