diff --git a/storage/watchable_store.go b/storage/watchable_store.go index 02c790f05..11c6f21ab 100644 --- a/storage/watchable_store.go +++ b/storage/watchable_store.go @@ -165,6 +165,7 @@ func (s *watchableStore) Close() error { } func (s *watchableStore) NewWatcher() Watcher { + watcherGauge.Inc() return &watcher{ watchable: s, ch: make(chan storagepb.Event, chanBufLen), diff --git a/storage/watcher.go b/storage/watcher.go index 7c274ad76..b9c46e7d0 100644 --- a/storage/watcher.go +++ b/storage/watcher.go @@ -56,7 +56,6 @@ func (ws *watcher) Watch(key []byte, prefix bool, startRev int64) CancelFunc { } // TODO: cancelFunc needs to be removed from the cancels when it is called. ws.cancels = append(ws.cancels, c) - watcherGauge.Inc() return c }