mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
Set default value of --metrics-max-age equal to --metrics-relist-interval
This commit is contained in:
parent
03bc47e9fb
commit
8d8bfc7c33
1 changed files with 5 additions and 1 deletions
|
|
@ -242,7 +242,6 @@ func main() {
|
|||
cmd := &PrometheusAdapter{
|
||||
PrometheusURL: "https://localhost",
|
||||
MetricsRelistInterval: 10 * time.Minute,
|
||||
MetricsMaxAge: 20 * time.Minute,
|
||||
}
|
||||
cmd.Name = "prometheus-metrics-adapter"
|
||||
cmd.addFlags()
|
||||
|
|
@ -251,6 +250,11 @@ func main() {
|
|||
klog.Fatalf("unable to parse flags: %v", err)
|
||||
}
|
||||
|
||||
// if --metrics-max-age is not set, make it equal to --metrics-relist-interval
|
||||
if cmd.MetricsMaxAge == 0 * time.Second {
|
||||
cmd.MetricsMaxAge = cmd.MetricsRelistInterval
|
||||
}
|
||||
|
||||
// make the prometheus client
|
||||
promClient, err := cmd.makePromClient()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue