Add metrics for mailserver errors (#1242)
This commit is contained in:
parent
e7c588fcd0
commit
b9baa48d87
|
@ -56,6 +56,9 @@ var (
|
||||||
archivedMeter = metrics.NewRegisteredMeter("mailserver/archivedEnvelopes", nil)
|
archivedMeter = metrics.NewRegisteredMeter("mailserver/archivedEnvelopes", nil)
|
||||||
archivedSizeMeter = metrics.NewRegisteredMeter("mailserver/archivedEnvelopesSize", nil)
|
archivedSizeMeter = metrics.NewRegisteredMeter("mailserver/archivedEnvelopesSize", nil)
|
||||||
archivedErrorsCounter = metrics.NewRegisteredCounter("mailserver/archiveErrors", nil)
|
archivedErrorsCounter = metrics.NewRegisteredCounter("mailserver/archiveErrors", nil)
|
||||||
|
requestValidationErrorsCounter = metrics.NewRegisteredCounter("mailserver/requestValidationErrors", nil)
|
||||||
|
processRequestErrorsCounter = metrics.NewRegisteredCounter("mailserver/processRequestErrors", nil)
|
||||||
|
historicResponseErrorsCounter = metrics.NewRegisteredCounter("mailserver/historicResponseErrors", nil)
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -252,13 +255,17 @@ func (s *WMailServer) DeliverMail(peer *whisper.Peer, request *whisper.Envelope)
|
||||||
if ok, lower, upper, bloom, limit, cursor := s.validateRequest(peer.ID(), request); ok {
|
if ok, lower, upper, bloom, limit, cursor := s.validateRequest(peer.ID(), request); ok {
|
||||||
_, lastEnvelopeHash, nextPageCursor, err := s.processRequest(peer, lower, upper, bloom, limit, cursor)
|
_, lastEnvelopeHash, nextPageCursor, err := s.processRequest(peer, lower, upper, bloom, limit, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
processRequestErrorsCounter.Inc(1)
|
||||||
log.Error(fmt.Sprintf("error in DeliverMail: %s", err))
|
log.Error(fmt.Sprintf("error in DeliverMail: %s", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := s.sendHistoricMessageResponse(peer, request, lastEnvelopeHash, nextPageCursor); err != nil {
|
if err := s.sendHistoricMessageResponse(peer, request, lastEnvelopeHash, nextPageCursor); err != nil {
|
||||||
|
historicResponseErrorsCounter.Inc(1)
|
||||||
log.Error(fmt.Sprintf("SendHistoricMessageResponse error: %s", err))
|
log.Error(fmt.Sprintf("SendHistoricMessageResponse error: %s", err))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
requestValidationErrorsCounter.Inc(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue