@@ -10,8 +10,10 @@ import (
1010var _ ports.Metrics = (* PrometheusMetrics )(nil )
1111
1212type PrometheusMetrics struct {
13- discarded * prometheus.CounterVec
14- valid * prometheus.CounterVec
13+ discarded * prometheus.CounterVec
14+ valid * prometheus.CounterVec
15+ scrapedTotal * prometheus.CounterVec
16+ sentTotal * prometheus.CounterVec
1517}
1618
1719func NewPrometheusMetrics () * PrometheusMetrics {
@@ -25,6 +27,20 @@ func NewPrometheusMetrics() *PrometheusMetrics {
2527 Name : "gorimpo_valid_total" ,
2628 Help : "Total de ofertas validas encontradas por termo" ,
2729 }, []string {"term" }),
30+
31+ scrapedTotal : promauto .NewCounterVec (
32+ prometheus.CounterOpts {
33+ Name : "gorimpo_scraped_total" ,
34+ Help : "Total bruto de itens raspados da plataforma" ,
35+ },
36+ []string {"term" }),
37+
38+ sentTotal : promauto .NewCounterVec (
39+ prometheus.CounterOpts {
40+ Name : "gorimpo_sent_total" ,
41+ Help : "Total de ofertas enviadas com sucesso pro Telegram" ,
42+ },
43+ []string {"term" }),
2844 }
2945}
3046
@@ -35,3 +51,11 @@ func (p *PrometheusMetrics) RecordDiscarded(term, reason string, count int) {
3551func (p * PrometheusMetrics ) RecordValid (term string , count int ) {
3652 p .valid .WithLabelValues (term ).Add (float64 (count ))
3753}
54+
55+ func (p * PrometheusMetrics ) RecordScraped (term string , count int ) {
56+ p .scrapedTotal .WithLabelValues (term ).Add (float64 (count ))
57+ }
58+
59+ func (p * PrometheusMetrics ) RecordSent (term string , count int ) {
60+ p .sentTotal .WithLabelValues (term ).Add (float64 (count ))
61+ }
0 commit comments