Use the configured label value as the regex pattern. Currently it is trying to match the value from the config using the object's label as the pattern, which is incorrect. See also the Annotations matching below which is doing it correctly.
leader election function is disabled by default, and could be enabled by adding the
following section in `config.yaml`:
```yaml
leaderElection:
enabled: true
leaderElectionID: kubernetes-event-exporter // this field can be omited, default value is kubernetes-event-exporter
```
Before the change, the engine didn't call the `Close()` method of the
sinks. This is needed in some cases, i.e when a sink implementation is
buffered.
This change adds a `Close()` method to the registry that
will signal sinks to exit and wait for all sinks to exit before
returning. This is then used in the engine stop logic.
In the channel-based registry, the closing of all sinks is done in
parallel (using a `sync.WaitGroup`). In the sync registry, sinks are
closed sequentially.
Fixes issue #10