[Reporting] queue.pollEnabled setting adds ability to disable polling for idle jobs (#24295)
* [Reporting] New queue.pollEnabled setting adds ability to disable polling for idle jobs * add an info log line * note in docs
This commit is contained in:
parent
5079e3d052
commit
6084acc8b6
3 changed files with 30 additions and 3 deletions
|
@ -51,8 +51,22 @@ reports, you might need to change the following settings.
|
||||||
How often the index that stores reporting jobs rolls over to a new index.
|
How often the index that stores reporting jobs rolls over to a new index.
|
||||||
Valid values are `year`, `month`, `week`, `day`, and `hour`. Defaults to `week`.
|
Valid values are `year`, `month`, `week`, `day`, and `hour`. Defaults to `week`.
|
||||||
|
|
||||||
|
`xpack.reporting.queue.pollEnabled`::
|
||||||
|
Set to `true` (default) to enable the Kibana instance to to poll the index for
|
||||||
|
pending jobs and claim them for execution. Setting this to `false` allows the
|
||||||
|
Kibana instance to only add new jobs to the reporting queue, list jobs, and
|
||||||
|
provide the downloads to completed report through the UI.
|
||||||
|
|
||||||
|
[NOTE]
|
||||||
|
============
|
||||||
|
Running multiple instances of Kibana in a cluster for load balancing of
|
||||||
|
reporting requires identical values for `xpack.reporting.encryptionKey` and, if
|
||||||
|
security is enabled, `xpack.security.encryptionKey`.
|
||||||
|
============
|
||||||
|
|
||||||
`xpack.reporting.queue.pollInterval`::
|
`xpack.reporting.queue.pollInterval`::
|
||||||
How often idle workers poll the index for pending jobs. Defaults to `3000` (3 seconds).
|
Specifies the number of milliseconds that idle workers wait between polling the
|
||||||
|
index for pending jobs. Defaults to `3000` (3 seconds).
|
||||||
|
|
||||||
[[xpack-reporting-q-timeout]]`xpack.reporting.queue.timeout`::
|
[[xpack-reporting-q-timeout]]`xpack.reporting.queue.timeout`::
|
||||||
How long each worker has to produce a report. If your machine is slow or under
|
How long each worker has to produce a report. If your machine is slow or under
|
||||||
|
|
|
@ -71,6 +71,7 @@ export const reporting = (kibana) => {
|
||||||
}).default(),
|
}).default(),
|
||||||
queue: Joi.object({
|
queue: Joi.object({
|
||||||
indexInterval: Joi.string().default('week'),
|
indexInterval: Joi.string().default('week'),
|
||||||
|
pollEnabled: Joi.boolean().default(true),
|
||||||
pollInterval: Joi.number().integer().default(3000),
|
pollInterval: Joi.number().integer().default(3000),
|
||||||
pollIntervalErrorMultiplier: Joi.number().integer().default(10),
|
pollIntervalErrorMultiplier: Joi.number().integer().default(10),
|
||||||
timeout: Joi.number().integer().default(120000),
|
timeout: Joi.number().integer().default(120000),
|
||||||
|
|
|
@ -18,18 +18,30 @@ function createQueueFn(server) {
|
||||||
const createWorkers = createWorkersFactory(server);
|
const createWorkers = createWorkersFactory(server);
|
||||||
const { getClient } = server.plugins.elasticsearch.getCluster('admin');
|
const { getClient } = server.plugins.elasticsearch.getCluster('admin');
|
||||||
|
|
||||||
|
const logger = createTaggedLogger(server, ['reporting', 'esqueue']);
|
||||||
const queueOptions = {
|
const queueOptions = {
|
||||||
doctype: QUEUE_DOCTYPE,
|
doctype: QUEUE_DOCTYPE,
|
||||||
interval: queueConfig.indexInterval,
|
interval: queueConfig.indexInterval,
|
||||||
timeout: queueConfig.timeout,
|
timeout: queueConfig.timeout,
|
||||||
dateSeparator: dateSeparator,
|
dateSeparator: dateSeparator,
|
||||||
client: getClient(),
|
client: getClient(),
|
||||||
logger: createTaggedLogger(server, ['reporting', 'esqueue'])
|
logger,
|
||||||
};
|
};
|
||||||
|
|
||||||
const queue = new Esqueue(index, queueOptions);
|
const queue = new Esqueue(index, queueOptions);
|
||||||
|
|
||||||
createWorkers(queue);
|
if (queueConfig.pollEnabled) {
|
||||||
|
// create workers to poll the index for idle jobs waiting to be claimed and executed
|
||||||
|
createWorkers(queue);
|
||||||
|
} else {
|
||||||
|
logger(
|
||||||
|
'xpack.reporting.queue.pollEnabled is set to false. This Kibana instance ' +
|
||||||
|
'will not poll for idle jobs to claim and execute. Make sure another ' +
|
||||||
|
'Kibana instance with polling enabled is running in this cluster so ' +
|
||||||
|
'reporting jobs can complete.',
|
||||||
|
['info']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return queue;
|
return queue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue