Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Sep 26, 2018
1 parent be6da31 commit 09dfa99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pkg/internal/controller/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,22 @@ import (
)

var (
// QueueLength is a prometheus metric which counts the current reconcile
// queue length per controller
QueueLength = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "controller_runtime_reconcile_queue_length",
Help: "Length of reconcile queue per controller",
}, []string{"controller"})

// ReconcileErrors is a prometheus counter metrics which holds the total
// number of errors from the Reconciler
ReconcileErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "controller_runtime_reconcile_errors_total",
Help: "Total number of reconcile errors per controller",
}, []string{"controller"})

// ReconcileTime is a prometheus metric which keeps track of the duration
// of reconciles
ReconcileTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: "controller_runtime_reconcile_time_second",
Help: "Length of time per reconcile per controller",
Expand Down
4 changes: 3 additions & 1 deletion pkg/manager/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ func (cm *controllerManager) serveMetrics(stop <-chan struct{}) {
// Shutdown the server when stop is closed
select {
case <-stop:
server.Shutdown(context.Background())
if err := server.Shutdown(context.Background()); err != nil {
cm.errChan <- err
}
}
}

Expand Down
1 change: 0 additions & 1 deletion pkg/metrics/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ limitations under the License.
/*
Package metrics contains controller related metrics utilities
*/

package metrics

0 comments on commit 09dfa99

Please sign in to comment.