Skip to content

Commit 4c4b9c9

Browse files
author
armin
committed
refactor: replace explicit log level constants with iota
1 parent 8ec2407 commit 4c4b9c9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kafka_exporter.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ const (
3737
)
3838

3939
const (
40-
INFO = 0
41-
DEBUG = 1
42-
TRACE = 2
40+
INFO = iota
41+
DEBUG
42+
TRACE
4343
)
4444

4545
var (
@@ -657,7 +657,7 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) {
657657
consumergroupCurrentOffset, prometheus.GaugeValue, float64(currentOffset), group.GroupId, topic, strconv.FormatInt(int64(partition), 10),
658658
)
659659
e.mu.Lock()
660-
currentPartitionOffset, currentPartitionOffsetError := e.client.GetOffset(topic, partition, sarama.OffsetNewest)
660+
currentPartitionOffset, currentPartitionOffsetError := e.client.GetOffset(topic, partition, sarama.OffsetNewest)
661661
if currentPartitionOffsetError != nil {
662662
klog.Errorf("Cannot get current offset of topic %s partition %d: %v", topic, partition, currentPartitionOffsetError)
663663
} else {
@@ -673,11 +673,11 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) {
673673
lag = currentPartitionOffset - offsetFetchResponseBlock.Offset
674674
lagSum += lag
675675
}
676-
676+
677677
ch <- prometheus.MustNewConstMetric(
678678
consumergroupLag, prometheus.GaugeValue, float64(lag), group.GroupId, topic, strconv.FormatInt(int64(partition), 10),
679679
)
680-
}
680+
}
681681
e.mu.Unlock()
682682
}
683683
ch <- prometheus.MustNewConstMetric(

0 commit comments

Comments
 (0)