Skip to content

Commit

Permalink
Fix visualize and lens telemetry (#67749)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 authored May 30, 2020
1 parent 96ef018 commit 6a8b07f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion x-pack/plugins/lens/server/usage/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6a8b07f

Please sign in to comment.