all: Add Prometheus-style metrics to expose some internal performance counters (fixes #5175) (#9003)
This commit is contained in:
@@ -297,6 +297,7 @@ loop:
|
||||
case e := <-l.events:
|
||||
// Incoming events get sent
|
||||
l.sendEvent(e)
|
||||
metricEvents.WithLabelValues(e.Type.String(), metricEventStateCreated).Inc()
|
||||
|
||||
case fn := <-l.funcs:
|
||||
// Subscriptions are handled here.
|
||||
@@ -345,9 +346,11 @@ func (l *logger) sendEvent(e Event) {
|
||||
|
||||
select {
|
||||
case s.events <- e:
|
||||
metricEvents.WithLabelValues(e.Type.String(), metricEventStateDelivered).Inc()
|
||||
case <-l.timeout.C:
|
||||
// if s.events is not ready, drop the event
|
||||
timedOut = true
|
||||
metricEvents.WithLabelValues(e.Type.String(), metricEventStateDropped).Inc()
|
||||
}
|
||||
|
||||
// If stop returns false it already sent something to the
|
||||
|
||||
Reference in New Issue
Block a user