diff --git a/ChangeLog b/ChangeLog index 30b1c8b4..3100aeb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Version 11.0.7 +-------------- + * adding label to currentBuilds metric + Version 11.0.6 -------------- * correcting env keys for worker and api servers diff --git a/VERSION b/VERSION index 5326b8b7..d65b4d44 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.0.6 +11.0.7 \ No newline at end of file diff --git a/mettle/worker/worker.go b/mettle/worker/worker.go index 27076f9b..414cdca1 100644 --- a/mettle/worker/worker.go +++ b/mettle/worker/worker.go @@ -57,10 +57,10 @@ var totalBuilds = prometheus.NewCounter(prometheus.CounterOpts{ Namespace: "mettle", Name: "builds_total", }) -var currentBuilds = prometheus.NewGauge(prometheus.GaugeOpts{ +var currentBuilds = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Namespace: "mettle", Name: "builds_current", -}) +}, []string{"instance"}) var executeDurations = prometheus.NewHistogram(prometheus.HistogramOpts{ Namespace: "mettle", Name: "build_durations_secs", @@ -471,8 +471,8 @@ func (w *worker) runTask(msg *pubsub.Message) *pb.ExecuteResponse { go w.extendAckDeadline(ctx, msg) } totalBuilds.Inc() - currentBuilds.Inc() - defer currentBuilds.Dec() + currentBuilds.WithLabelValues(w.instanceName).Inc() + defer currentBuilds.WithLabelValues(w.instanceName).Dec() w.metadata = &pb.ExecutedActionMetadata{ Worker: w.name, WorkerStartTimestamp: ptypes.TimestampNow(),