@@ -11,8 +11,9 @@ const Name = "kafka_konsumer"
11
11
type MetricCollector struct {
12
12
consumerMetric * ConsumerMetric
13
13
14
- totalUnprocessedMessagesCounter * prometheus.Desc
15
- totalProcessedMessagesCounter * prometheus.Desc
14
+ totalUnprocessedMessagesCounter * prometheus.Desc
15
+ totalProcessedMessagesCounter * prometheus.Desc
16
+ totalErrorCountDuringFetchingMessage * prometheus.Desc
16
17
}
17
18
18
19
func NewMetricCollector (metricPrefix string , consumerMetric * ConsumerMetric ) * MetricCollector {
@@ -35,6 +36,12 @@ func NewMetricCollector(metricPrefix string, consumerMetric *ConsumerMetric) *Me
35
36
emptyStringList ,
36
37
nil ,
37
38
),
39
+ totalErrorCountDuringFetchingMessage : prometheus .NewDesc (
40
+ prometheus .BuildFQName (metricPrefix , "error_count_during_fetching_message_total" , "current" ),
41
+ "Total number of error during fetching message." ,
42
+ emptyStringList ,
43
+ nil ,
44
+ ),
38
45
}
39
46
}
40
47
@@ -58,6 +65,13 @@ func (s *MetricCollector) Collect(ch chan<- prometheus.Metric) {
58
65
float64 (s .consumerMetric .TotalUnprocessedMessagesCounter ),
59
66
emptyStringList ... ,
60
67
)
68
+
69
+ ch <- prometheus .MustNewConstMetric (
70
+ s .totalErrorCountDuringFetchingMessage ,
71
+ prometheus .CounterValue ,
72
+ float64 (s .consumerMetric .TotalErrorCountDuringFetchingMessage ),
73
+ emptyStringList ... ,
74
+ )
61
75
}
62
76
63
77
func NewMetricMiddleware (cfg * ConsumerConfig ,
0 commit comments