loki: do not convert NaN to null (#45389)

This commit is contained in:
Gábor Farkas 2022-04-07 09:44:04 +02:00 committed by GitHub
parent 0639ccbdff
commit 6e0826a986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -306,7 +306,7 @@ describe('enhanceDataFrame', () => {
[1, 1000],
[0, 2000],
[1, 4000],
[null, 7000],
[NaN, 7000],
[Infinity, 8000],
[-Infinity, 9000],
]);

View File

@ -209,10 +209,6 @@ export function lokiPointsToTimeseriesPoints(data: Array<[number, string]>): Tim
for (const [time, value] of data) {
let datapointValue: TimeSeriesValue = parsePrometheusFormatSampleValue(value);
if (isNaN(datapointValue)) {
datapointValue = null;
}
const timestamp = time * 1000;
datapoints.push([datapointValue, timestamp]);