Skip to content

Commit

Permalink
Prevent overzealous collection of Metric events through Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Reagor committed Dec 7, 2017
1 parent 4cc285b commit c0f1fb3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion events/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ func (bus *EventBus) Publish(event Event) {
bus.lock.Lock()
defer bus.lock.Unlock()
log.Debugf("event: %v", event)
collector.WithLabelValues(event.Code.String(), event.Source).Inc()

if event.Code.String() != "Metric" {
collector.WithLabelValues(event.Code.String(), event.Source).Inc()
}

for subscriber := range bus.registry {
// sending to an unsubscribed Subscriber shouldn't be a runtime
// error, so this is in intentionally allowed to panic here
Expand Down

0 comments on commit c0f1fb3

Please sign in to comment.