Skip to content

Commit

Permalink
Switch to new elasticsearch client for TSVB (#85275)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
alexwizp and kibanamachine committed Dec 10, 2020
1 parent 7d8ca7b commit be0372f
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ export class ValidationTelemetryService implements Plugin<ValidationTelemetrySer
usageCollection.makeUsageCollector<Usage>({
type: 'tsvb-validation',
isReady: () => this.kibanaIndex !== '',
fetch: async ({ callCluster }) => {
fetch: async ({ esClient }) => {
try {
const response = await callCluster('get', {
index: this.kibanaIndex,
id: 'tsvb-validation-telemetry:tsvb-validation-telemetry',
ignore: [404],
});
const { body: response } = await esClient.get(
{
index: this.kibanaIndex,
id: 'tsvb-validation-telemetry:tsvb-validation-telemetry',
},
{ ignore: [404] }
);
return {
failed_validations:
response?._source?.['tsvb-validation-telemetry']?.failedRequests || 0,
Expand Down

0 comments on commit be0372f

Please sign in to comment.