[ML] APM Correlations: Fix percentiles values. (#116639)

A change in the ES range agg no longer accepts numbers with decimals if the underlying field is typed as long. This PR fixes the issue by rounding the percentiles values we pass on to the range agg.
This commit is contained in:
Walter Rafelsberger 2021-11-02 11:40:58 +01:00 committed by GitHub
parent c7f7cd39f5
commit 0593c614a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,11 @@ export const latencyCorrelationsSearchServiceProvider: LatencyCorrelationsSearch
params,
percentileAggregationPercents
);
const percentiles = Object.values(percentilesRecords);
// We need to round the percentiles values
// because the queries we're using based on it
// later on wouldn't allow numbers with decimals.
const percentiles = Object.values(percentilesRecords).map(Math.round);
addLogMessage(`Loaded percentiles.`);