mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Added a setting to allow disabling the exporter.
This commit is contained in:
parent
9a9328db12
commit
5553189cb6
1 changed files with 15 additions and 3 deletions
|
@ -92,16 +92,24 @@ public class ExportersService extends AbstractLifecycleComponent<ExportersServic
|
|||
this.indicesToExport = componentSettings.getAsArray("indices", this.indicesToExport, true);
|
||||
this.client = client;
|
||||
|
||||
StatsExporter esExporter = new ESExporter(settings.getComponentSettings(ESExporter.class), discovery);
|
||||
this.exporters = ImmutableSet.of(esExporter);
|
||||
|
||||
indicesLifeCycleListener = new IndicesLifeCycleListener();
|
||||
clusterStateEventListener = new ClusterStateListener();
|
||||
pendingEventsQueue = ConcurrentCollections.newBlockingQueue();
|
||||
|
||||
if (componentSettings.getAsBoolean("enabled", true)) {
|
||||
StatsExporter esExporter = new ESExporter(settings.getComponentSettings(ESExporter.class), discovery);
|
||||
this.exporters = ImmutableSet.of(esExporter);
|
||||
} else {
|
||||
this.exporters = ImmutableSet.of();
|
||||
logger.info("monitoring disabled by settings");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStart() throws ElasticSearchException {
|
||||
if (exporters.size() == 0) {
|
||||
return;
|
||||
}
|
||||
for (StatsExporter e : exporters)
|
||||
e.start();
|
||||
|
||||
|
@ -116,6 +124,9 @@ public class ExportersService extends AbstractLifecycleComponent<ExportersServic
|
|||
|
||||
@Override
|
||||
protected void doStop() throws ElasticSearchException {
|
||||
if (exporters.size() == 0) {
|
||||
return;
|
||||
}
|
||||
this.exp.closed = true;
|
||||
this.thread.interrupt();
|
||||
try {
|
||||
|
@ -268,6 +279,7 @@ public class ExportersService extends AbstractLifecycleComponent<ExportersServic
|
|||
pendingEventsQueue.add(new NodeEvent.NodeJoinLeave(timestamp, node, false, event.source()));
|
||||
}
|
||||
|
||||
|
||||
if (event.routingTableChanged()) {
|
||||
// hunt for initializing shards
|
||||
RoutingNodes previousRoutingNodes = event.previousState().routingNodes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue