diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol b/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol index 459f78b95168a4d17acae03e892b17bc78f8f4e5..3f44392c3b3502b4f3066e7ec89c794bc9ffb54d 160000 --- a/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol +++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol @@ -1 +1 @@ -Subproject commit 459f78b95168a4d17acae03e892b17bc78f8f4e5 +Subproject commit 3f44392c3b3502b4f3066e7ec89c794bc9ffb54d diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TopNRecordsQueryEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TopNRecordsQueryEsDAO.java index c18dc38318f3dc3f2c82b97e13e02f50984dd9fe..fa177767ebcaa22ead3b824855e2de4a8532d741 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TopNRecordsQueryEsDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/TopNRecordsQueryEsDAO.java @@ -21,6 +21,7 @@ package org.apache.skywalking.oap.server.storage.plugin.elasticsearch.query; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.apache.skywalking.apm.util.StringUtil; import org.apache.skywalking.oap.server.core.analysis.IDManager; import org.apache.skywalking.oap.server.core.analysis.topn.TopN; @@ -67,9 +68,11 @@ public class TopNRecordsQueryEsDAO extends EsDAO implements ITopNRecordsQueryDAO for (SearchHit searchHit : response.getHits().getHits()) { SelectedRecord record = new SelectedRecord(); - record.setName((String) searchHit.getSourceAsMap().get(TopN.STATEMENT)); - record.setRefId((String) searchHit.getSourceAsMap().get(TopN.TRACE_ID)); - record.setValue(((Number) searchHit.getSourceAsMap().get(valueColumnName)).toString()); + final Map sourceAsMap = searchHit.getSourceAsMap(); + record.setName((String) sourceAsMap.get(TopN.STATEMENT)); + record.setRefId((String) sourceAsMap.get(TopN.TRACE_ID)); + record.setId(record.getRefId()); + record.setValue(((Number) sourceAsMap.get(valueColumnName)).toString()); results.add(record); } 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 9f9e56f0abca00b71ada60c9b36492fc83e73a6b..d44f4f796abd734eb5c202a61ed345832a923c53 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 @@ -89,6 +89,7 @@ public class TopNRecordsQuery implements ITopNRecordsQueryDAO { SelectedRecord record = new SelectedRecord(); record.setValue(String.valueOf(values.get(1))); record.setRefId((String) values.get(3)); + record.setId(record.getRefId()); record.setName((String) values.get(2)); records.add(record); }); diff --git a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TopNRecordsQueryDAO.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TopNRecordsQueryDAO.java index 058c544f2b3bbb202bc04400f1f8026fb435910c..fe34e0ef37b1e89700e2fa43578a6fba5f891152 100644 --- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TopNRecordsQueryDAO.java +++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TopNRecordsQueryDAO.java @@ -75,6 +75,7 @@ public class H2TopNRecordsQueryDAO implements ITopNRecordsQueryDAO { SelectedRecord record = new SelectedRecord(); record.setName(resultSet.getString(TopN.STATEMENT)); record.setRefId(resultSet.getString(TopN.TRACE_ID)); + record.setId(record.getRefId()); record.setValue(resultSet.getString(valueColumnName)); results.add(record); }