diff --git a/CHANGES.md b/CHANGES.md index 466d45e97..e4bcd0367 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -53,6 +53,7 @@ Release Notes. * Fix bug that `endpoint-name-grouping.yml` is not customizable in Dockerized case. * Fix bug that istio version metric type on UI template mismatches the otel rule. * Improve ReadWriteSafeCache concurrency read-write performance +* Fix bug that if use JSON as InfluxDB.ResponseFormat then NumberFormatException maybe occur. #### UI * Fix un-removed tags in trace query. diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TopNRecordsQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TopNRecordsQuery.java index 7284214a8..4835710b2 100644 --- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TopNRecordsQuery.java +++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/TopNRecordsQuery.java @@ -101,8 +101,8 @@ public class TopNRecordsQuery implements ITopNRecordsQueryDAO { } private static final Comparator ASCENDING = Comparator.comparingLong( - a -> Long.parseLong(a.getValue())); + a -> ((Number) Double.parseDouble(a.getValue())).longValue()); private static final Comparator DESCENDING = (a, b) -> Long.compare( - Long.parseLong(b.getValue()), Long.parseLong(a.getValue())); + ((Number) Double.parseDouble(b.getValue())).longValue(), ((Number) Double.parseDouble(a.getValue())).longValue()); }