Skip to content

Commit

Permalink
[7.8] [Fix] Monitoring failing to start (elastic#65516) (elastic#65730)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored May 7, 2020
1 parent a33983e commit 2711884
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class BulkUploader {
async _fetchAndUpload(usageCollection) {
const collectorsReady = await usageCollection.areAllCollectorsReady();
const hasUsageCollectors = usageCollection.some(usageCollection.isUsageCollector);
if (!collectorsReady) {
if (!collectorsReady || typeof this.kibanaStatusGetter !== 'function') {
this._log.debug('Skipping bulk uploading because not all collectors are ready');
if (hasUsageCollectors) {
this._lastFetchUsageTime = null;
Expand All @@ -151,7 +151,7 @@ export class BulkUploader {

const data = await usageCollection.bulkFetch(this._cluster.callAsInternalUser);
const payload = this.toBulkUploadFormat(compact(data), usageCollection);
if (payload) {
if (payload && payload.length > 0) {
try {
this._log.debug(`Uploading bulk stats payload to the local cluster`);
const result = await this._onPayload(payload);
Expand Down Expand Up @@ -244,7 +244,7 @@ export class BulkUploader {
*/
toBulkUploadFormat(rawData, usageCollection) {
if (rawData.length === 0) {
return;
return [];
}

// convert the raw data to a nested object by taking each payload through
Expand Down

0 comments on commit 2711884

Please sign in to comment.