Skip to content

Commit

Permalink
🐛 [patch] Fix wrong removing queue metric (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny299 authored May 5, 2020
1 parent 5d2b34f commit 8362d7a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/samsahai/exporter/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
queueStateDeploying QueueMetricState = "deploying"
queueStateTesting QueueMetricState = "testing"
queueStateCleaning QueueMetricState = "cleaning"
queueStateFinished QueueMetricState = "finished"
)

var logger = s2hlog.S2HLog.WithName("exporter")
Expand Down Expand Up @@ -79,11 +80,7 @@ func SetQueueMetric(queue *s2hv1beta1.Queue) {
case s2hv1beta1.CleaningBefore:
queueState = queueStateCleaning
case s2hv1beta1.CleaningAfter:
q, err := QueueMetric.CurryWith(prometheus.Labels{"component": queue.Name, "version": queue.Spec.Version})
if err != nil {
logger.Error(err, "cannot get finished queue metric")
}
q.Reset()
queueState = queueStateFinished
}

QueueMetric.WithLabelValues(
Expand Down

0 comments on commit 8362d7a

Please sign in to comment.