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),
|
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{
|
metrics = append(metrics, Metric{
|
||||||
Description: MetricDescription{
|
Description: MetricDescription{
|
||||||
Namespace: minioNamespace,
|
Namespace: minioNamespace,
|
||||||
|
@ -57,6 +57,7 @@ type TargetStats struct {
|
|||||||
TotalEvents int64
|
TotalEvents int64
|
||||||
EventsSkipped int64
|
EventsSkipped int64
|
||||||
CurrentQueuedCalls int64
|
CurrentQueuedCalls int64
|
||||||
|
EventsErrorsTotal int64
|
||||||
|
|
||||||
TargetStats map[string]TargetStat
|
TargetStats map[string]TargetStat
|
||||||
}
|
}
|
||||||
@ -70,9 +71,10 @@ type TargetStat struct {
|
|||||||
// TargetList - holds list of targets indexed by target ID.
|
// TargetList - holds list of targets indexed by target ID.
|
||||||
type TargetList struct {
|
type TargetList struct {
|
||||||
// The number of concurrent async Send calls to all targets
|
// The number of concurrent async Send calls to all targets
|
||||||
currentSendCalls atomic.Int64
|
currentSendCalls atomic.Int64
|
||||||
totalEvents atomic.Int64
|
totalEvents atomic.Int64
|
||||||
eventsSkipped atomic.Int64
|
eventsSkipped atomic.Int64
|
||||||
|
eventsErrorsTotal atomic.Int64
|
||||||
|
|
||||||
sync.RWMutex
|
sync.RWMutex
|
||||||
targets map[TargetID]Target
|
targets map[TargetID]Target
|
||||||
@ -205,6 +207,7 @@ func (list *TargetList) sendSync(event Event, targetIDset TargetIDSet) {
|
|||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
if err := target.Save(event); err != nil {
|
if err := target.Save(event); err != nil {
|
||||||
|
list.eventsErrorsTotal.Add(1)
|
||||||
reqInfo := &logger.ReqInfo{}
|
reqInfo := &logger.ReqInfo{}
|
||||||
reqInfo.AppendTags("targetID", id.String())
|
reqInfo.AppendTags("targetID", id.String())
|
||||||
logger.LogOnceIf(logger.SetReqInfo(context.Background(), reqInfo), err, 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.EventsSkipped = list.eventsSkipped.Load()
|
||||||
t.TotalEvents = list.totalEvents.Load()
|
t.TotalEvents = list.totalEvents.Load()
|
||||||
t.CurrentQueuedCalls = int64(len(list.queue))
|
t.CurrentQueuedCalls = int64(len(list.queue))
|
||||||
|
t.EventsErrorsTotal = list.eventsErrorsTotal.Load()
|
||||||
|
|
||||||
list.RLock()
|
list.RLock()
|
||||||
defer list.RUnlock()
|
defer list.RUnlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user