mirror of
https://github.com/minio/minio.git
synced 2025-03-20 12:34:16 -04:00
feat: add events_errors_total metric (#18610)
This commit is contained in:
parent
2e23e61a45
commit
6ca6788bb7
@ -2475,6 +2475,16 @@ func getNotificationMetrics() *MetricsGroup {
|
||||
},
|
||||
Value: float64(nstats.EventsSkipped),
|
||||
})
|
||||
metrics = append(metrics, Metric{
|
||||
Description: MetricDescription{
|
||||
Namespace: minioNamespace,
|
||||
Subsystem: notifySubsystem,
|
||||
Name: "events_errors_total",
|
||||
Help: "Events that were failed while sending to target",
|
||||
Type: counterMetric,
|
||||
},
|
||||
Value: float64(nstats.EventsErrorsTotal),
|
||||
})
|
||||
metrics = append(metrics, Metric{
|
||||
Description: MetricDescription{
|
||||
Namespace: minioNamespace,
|
||||
|
@ -57,6 +57,7 @@ type TargetStats struct {
|
||||
TotalEvents int64
|
||||
EventsSkipped int64
|
||||
CurrentQueuedCalls int64
|
||||
EventsErrorsTotal int64
|
||||
|
||||
TargetStats map[string]TargetStat
|
||||
}
|
||||
@ -73,6 +74,7 @@ type TargetList struct {
|
||||
currentSendCalls atomic.Int64
|
||||
totalEvents atomic.Int64
|
||||
eventsSkipped atomic.Int64
|
||||
eventsErrorsTotal atomic.Int64
|
||||
|
||||
sync.RWMutex
|
||||
targets map[TargetID]Target
|
||||
@ -205,6 +207,7 @@ func (list *TargetList) sendSync(event Event, targetIDset TargetIDSet) {
|
||||
defer wg.Done()
|
||||
|
||||
if err := target.Save(event); err != nil {
|
||||
list.eventsErrorsTotal.Add(1)
|
||||
reqInfo := &logger.ReqInfo{}
|
||||
reqInfo.AppendTags("targetID", id.String())
|
||||
logger.LogOnceIf(logger.SetReqInfo(context.Background(), reqInfo), err, id.String())
|
||||
@ -246,6 +249,7 @@ func (list *TargetList) Stats() TargetStats {
|
||||
t.EventsSkipped = list.eventsSkipped.Load()
|
||||
t.TotalEvents = list.totalEvents.Load()
|
||||
t.CurrentQueuedCalls = int64(len(list.queue))
|
||||
t.EventsErrorsTotal = list.eventsErrorsTotal.Load()
|
||||
|
||||
list.RLock()
|
||||
defer list.RUnlock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user