Skip to content

Commit

Permalink
Fix redundant system event (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthenw committed Jul 24, 2018
1 parent c563910 commit 7944f7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/prometheus-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Both Events and Configuration API exposes Prometheus metrics. The metrics are ac

| Metric Name | Description | Type | Labels |
| --------------------------------- | ------------------------------------------------------------ | ------- | ---------------- |
| `gateway_events_received_total` | Total of events received. | Counter | `space`, `type` |
| `gateway_events_received_total` | Total of events received. | Counter | `space`, `type` |
| `gateway_events_processed_total` | Total of processed events. | Counter | `space`, `type` |
| `gateway_events_dropped_total` | Total of events dropped due to insufficient processing power. | Counter | `space`, `type` |
| `gateway_events_backlog` | Gauge of asynchronous events count waiting to be processed. | Gauge | |
Expand Down
11 changes: 1 addition & 10 deletions router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,9 @@ var (
)

func (router *Router) handleSyncSubscription(path string, event eventpkg.Event, subscriber SyncSubscriber, w http.ResponseWriter, r *http.Request) {
// metrics & logs
metricEventsReceived.WithLabelValues(subscriber.Space, string(event.EventType)).Inc()
router.log.Debug("Event received.", zap.String("path", path), zap.String("space", subscriber.Space), zap.Object("event", event))
err := router.emitSystemEventReceived(path, event, r.Header)
if err != nil {
router.log.Debug("Event processing stopped because sync plugin subscription returned an error.",
zap.Object("event", event),
zap.Error(err))
return
}

err = router.authorizeEventType(subscriber.Space, &event, r)
err := router.authorizeEventType(subscriber.Space, &event, r)
if err != nil {
w.WriteHeader(http.StatusForbidden)
return
Expand Down

0 comments on commit 7944f7a

Please sign in to comment.