Fix visualize and lens telemetry (#67749)

This commit is contained in:
Joe Reuter 2020-05-30 21:22:42 +02:00 committed by GitHub
parent 96ef01828c
commit 6a8b07fe8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -6,6 +6,7 @@
import { APICaller, CoreSetup, Logger } from 'kibana/server';
import { Observable } from 'rxjs';
import { first } from 'rxjs/operators';
import moment from 'moment';
import {
RunContext,
@ -191,7 +192,7 @@ export function telemetryTaskRunner(
return {
async run() {
const kibanaIndex = (await config.toPromise()).kibana.index;
const kibanaIndex = (await config.pipe(first()).toPromise()).kibana.index;
return Promise.all([
getDailyEvents(kibanaIndex, callCluster),

View file

@ -6,6 +6,8 @@
import { Observable } from 'rxjs';
import _, { countBy, groupBy, mapValues } from 'lodash';
import { first } from 'rxjs/operators';
import { APICaller, IClusterClient } from 'src/core/server';
import { getNextMidnight } from '../../get_next_midnight';
import { TaskInstance } from '../../../../../task_manager/server';
@ -80,7 +82,7 @@ export function visualizationsTaskRunner(
let error;
try {
const index = (await config.toPromise()).kibana.index;
const index = (await config.pipe(first()).toPromise()).kibana.index;
stats = await getStats((await esClientPromise).callAsInternalUser, index);
} catch (err) {
if (err.constructor === Error) {