Skip to content

Commit

Permalink
Merge pull request #230 from weibeld/master
Browse files Browse the repository at this point in the history
Set --metrics-max-age default value equal to relist interval
  • Loading branch information
s-urbaniak authored Sep 4, 2020
2 parents 9c77438 + 4788770 commit 2678f90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func main() {
cmd := &PrometheusAdapter{
PrometheusURL: "https://localhost",
MetricsRelistInterval: 10 * time.Minute,
MetricsMaxAge: 20 * time.Minute,
}
cmd.Name = "prometheus-metrics-adapter"
cmd.addFlags()
Expand All @@ -248,6 +247,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 {
Expand Down

0 comments on commit 2678f90

Please sign in to comment.