all repos

onasty @ 184b6cc

a one-time notes service
1 files changed, 0 insertions(+), 28 deletions(-)
refactor: remove unused code (#66)

Author: Smirnov Oleksandr ss2316544@gmail.com
Committed by: GitHub noreply@github.com
Committed at: 2025-01-15 18:14:53 +0200
Parent: 229e876
D internal/metrics/mail_metrics.go
ยทยทยท
        1
        
        -package metrics

      
        2
        
        -

      
        3
        
        -import (

      
        4
        
        -	"github.com/prometheus/client_golang/prometheus"

      
        5
        
        -	"github.com/prometheus/client_golang/prometheus/promauto"

      
        6
        
        -)

      
        7
        
        -

      
        8
        
        -var (

      
        9
        
        -	emailSentSuccessfully = promauto.NewCounter(prometheus.CounterOpts{ //nolint:exhaustruct

      
        10
        
        -		Name: "mail_sent_total",

      
        11
        
        -		Help: "the total number of successfully sent email",

      
        12
        
        -	})

      
        13
        
        -

      
        14
        
        -	emailFailedToSend = promauto.NewCounterVec(prometheus.CounterOpts{ //nolint:exhaustruct

      
        15
        
        -		Name: "mail_failed_total",

      
        16
        
        -		Help: "the total number of email that failed to send",

      
        17
        
        -	}, []string{"request_id"})

      
        18
        
        -)

      
        19
        
        -

      
        20
        
        -func RecordEmailSent() {

      
        21
        
        -	go emailSentSuccessfully.Inc()

      
        22
        
        -}

      
        23
        
        -

      
        24
        
        -func RecordEmailFailed(reqid string) {

      
        25
        
        -	go emailFailedToSend.With(prometheus.Labels{

      
        26
        
        -		"request_id": reqid,

      
        27
        
        -	}).Inc()

      
        28
        
        -}