Skip to content

Commit

Permalink
Merge pull request #504 from aleksandra-malinowska/no-lead-no-metrics
Browse files Browse the repository at this point in the history
Don't register metrics unless on leading master
  • Loading branch information
MaciekPytel authored Dec 15, 2017
2 parents 6b9c9ec + 312f989 commit af51acc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ func registerSignalHandlers(autoscaler core.Autoscaler) {
}

func run(healthCheck *metrics.HealthCheck) {
metrics.RegisterAll()
kubeClient := createKubeClient()
kubeEventRecorder := kube_util.CreateEventRecorder(kubeClient)
opts := createAutoscalerOptions()
Expand Down
3 changes: 2 additions & 1 deletion cluster-autoscaler/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ var (
)
)

func init() {
// RegisterAll registers all metrics.
func RegisterAll() {
prometheus.MustRegister(clusterSafeToAutoscale)
prometheus.MustRegister(nodesCount)
prometheus.MustRegister(nodeGroupsCount)
Expand Down

0 comments on commit af51acc

Please sign in to comment.