You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2020/11/17 03:36:09 UTC

[skywalking] branch service-group created (now 9132f75)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a change to branch service-group
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at 9132f75  Support group in the service traffic and service list query.

This branch includes the following new commits:

     new 9132f75  Support group in the service traffic and service list query.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: Support group in the service traffic and service list query.

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch service-group
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 9132f7511751c6f8116c10cc7620ed4763d49db7
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Tue Nov 17 11:34:54 2020 +0800

    Support group in the service traffic and service list query.
---
 docs/en/setup/backend/backend-setup.md             |  1 +
 docs/en/setup/backend/service-auto-grouping.md     | 16 +++++++++
 .../apache/skywalking/oap/server/core/Const.java   |  1 +
 .../analysis/manual/service/ServiceTraffic.java    | 17 +++++++++-
 .../server/core/query/MetadataQueryService.java    | 10 +++---
 .../core/storage/query/IMetadataQueryDAO.java      | 39 +++++++++++++++++++---
 .../oap/query/graphql/resolver/MetadataQuery.java  |  8 ++---
 .../src/main/resources/query-protocol              |  2 +-
 .../elasticsearch/query/MetadataQueryEsDAO.java    | 12 ++++---
 .../storage/plugin/influxdb/InfluxConstants.java   |  2 ++
 .../storage/plugin/influxdb/TableMetaInfo.java     |  3 +-
 .../plugin/influxdb/query/MetadataQuery.java       | 15 ++++++---
 .../plugin/jdbc/h2/dao/H2MetadataQueryDAO.java     | 11 ++++--
 13 files changed, 108 insertions(+), 29 deletions(-)

diff --git a/docs/en/setup/backend/backend-setup.md b/docs/en/setup/backend/backend-setup.md
index c41db9e..fbcc804 100755
--- a/docs/en/setup/backend/backend-setup.md
+++ b/docs/en/setup/backend/backend-setup.md
@@ -108,6 +108,7 @@ or 3rd party configuration management system.
 1. [Uninstrumented Gateways](uninstrumented-gateways.md). Configure gateways/proxies that are not supported by SkyWalking agent plugins,
 to reflect the delegation in topology graph.
 1. [Apdex threshold](apdex-threshold.md). Configure the thresholds for different services if Apdex calculation is activated in the OAL.
+1. [Service Grouping](service-auto-grouping.md). An automatic grouping mechanism for all services based on name..
 1. [Group Parameterized Endpoints](endpoint-grouping-rules.md). Configure the grouping rules for parameterized endpoints,
 to improve the meaning of the metrics.
 1. [Meter Analysis](backend-meter.md). Set up the backend analysis rules, when use [SkyWalking Meter System Toolkit](../service-agent/java-agent/README.md#advanced-features) 
diff --git a/docs/en/setup/backend/service-auto-grouping.md b/docs/en/setup/backend/service-auto-grouping.md
new file mode 100644
index 0000000..a92b3aa
--- /dev/null
+++ b/docs/en/setup/backend/service-auto-grouping.md
@@ -0,0 +1,16 @@
+# Service Auto Grouping
+SkyWalking supports various default and customized dashboard templates. 
+Each template provides the reasonable layout for the services in the particular field. 
+Such as, services with a language agent installed 
+could have different metrics with service detected by the service mesh observability solution, 
+and different with SkyWalking's self-observability metrics dashboard.
+
+Therefore, since 8.3.0, SkyWalking OAP would generate the group based on this simple naming format.
+
+### ${service name} = [${group name}:]${logic name}
+
+Once the service name includes `:`(colon), the literal string before the colon would be considered as the group name.
+In the latest GraphQL query, the group name has been provided as an option parameter.
+> getAllServices(duration: Duration!, group: String): [Service!]!
+
+RocketBot UI dashboards(`Standard` type) support the `group name` for default and custom configurations.
\ No newline at end of file
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java
index 3592bc8..499bc18 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/Const.java
@@ -39,4 +39,5 @@ public class Const {
     public static final String UNKNOWN = "Unknown";
     public static final String EMPTY_STRING = "";
     public static final String POINT = ".";
+    public static final String DOUBLE_COLONS_SPLIT = "::";
 }
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/service/ServiceTraffic.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/service/ServiceTraffic.java
index 2f63566..848a6dd 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/service/ServiceTraffic.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/service/ServiceTraffic.java
@@ -35,6 +35,8 @@ import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
 import org.apache.skywalking.oap.server.core.storage.StorageBuilder;
 import org.apache.skywalking.oap.server.core.storage.annotation.Column;
 
+import static org.apache.skywalking.oap.server.core.Const.DOUBLE_COLONS_SPLIT;
+
 @Stream(name = ServiceTraffic.INDEX_NAME, scopeId = DefaultScopeDefine.SERVICE,
     builder = ServiceTraffic.Builder.class, processor = MetricsStreamProcessor.class)
 @MetricsExtension(supportDownSampling = false, supportUpdate = false)
@@ -47,6 +49,7 @@ public class ServiceTraffic extends Metrics {
 
     public static final String NAME = "name";
     public static final String NODE_TYPE = "node_type";
+    public static final String GROUP = "group";
 
     @Setter
     @Getter
@@ -58,6 +61,11 @@ public class ServiceTraffic extends Metrics {
     @Column(columnName = NODE_TYPE)
     private NodeType nodeType;
 
+    @Setter
+    @Getter
+    @Column(columnName = GROUP)
+    private String group;
+
     @Override
     public String id() {
         return IDManager.ServiceID.buildId(name, nodeType);
@@ -93,14 +101,21 @@ public class ServiceTraffic extends Metrics {
             ServiceTraffic serviceTraffic = new ServiceTraffic();
             serviceTraffic.setName((String) dbMap.get(NAME));
             serviceTraffic.setNodeType(NodeType.valueOf(((Number) dbMap.get(NODE_TYPE)).intValue()));
+            serviceTraffic.setGroup((String) dbMap.get(GROUP));
             return serviceTraffic;
         }
 
         @Override
         public Map<String, Object> data2Map(final ServiceTraffic storageData) {
+            final String serviceName = storageData.getName();
+            int groupIdx = serviceName.indexOf(DOUBLE_COLONS_SPLIT);
+            if (groupIdx > 0) {
+                storageData.setGroup(serviceName.substring(0, groupIdx));
+            }
             Map<String, Object> map = new HashMap<>();
-            map.put(NAME, storageData.getName());
+            map.put(NAME, serviceName);
             map.put(NODE_TYPE, storageData.getNodeType().value());
+            map.put(GROUP, storageData.getGroup());
             return map;
         }
     }
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
index b373fe4..696dcb1 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java
@@ -46,12 +46,12 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
         return metadataQueryDAO;
     }
 
-    public List<Service> getAllServices(final long startTimestamp, final long endTimestamp) throws IOException {
-        return getMetadataQueryDAO().getAllServices(startTimestamp, endTimestamp);
+    public List<Service> getAllServices(final String group) throws IOException {
+        return getMetadataQueryDAO().getAllServices(group);
     }
 
-    public List<Service> getAllBrowserServices(final long startTimestamp, final long endTimestamp) throws IOException {
-        return getMetadataQueryDAO().getAllBrowserServices(startTimestamp, endTimestamp);
+    public List<Service> getAllBrowserServices() throws IOException {
+        return getMetadataQueryDAO().getAllBrowserServices();
     }
 
     public List<Database> getAllDatabases() throws IOException {
@@ -60,7 +60,7 @@ public class MetadataQueryService implements org.apache.skywalking.oap.server.li
 
     public List<Service> searchServices(final long startTimestamp, final long endTimestamp,
                                         final String keyword) throws IOException {
-        return getMetadataQueryDAO().searchServices(startTimestamp, endTimestamp, keyword);
+        return getMetadataQueryDAO().searchServices(keyword);
     }
 
     public List<ServiceInstance> getServiceInstances(final long startTimestamp, final long endTimestamp,
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetadataQueryDAO.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetadataQueryDAO.java
index 9140031..ad792e0 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetadataQueryDAO.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/query/IMetadataQueryDAO.java
@@ -27,19 +27,48 @@ import org.apache.skywalking.oap.server.core.query.type.ServiceInstance;
 import org.apache.skywalking.oap.server.core.storage.DAO;
 
 public interface IMetadataQueryDAO extends DAO {
-    List<Service> getAllServices(final long startTimestamp, final long endTimestamp) throws IOException;
+    /**
+     * @param group group name for filtering.
+     * @return list of the all available normal services
+     */
+    List<Service> getAllServices(final String group) throws IOException;
 
-    List<Service> getAllBrowserServices(long startTimestamp, long endTimestamp) throws IOException;
+    /**
+     * @return list of the all available browser services
+     */
+    List<Service> getAllBrowserServices() throws IOException;
 
+    /**
+     * @return list of all conjecture database services.
+     */
     List<Database> getAllDatabases() throws IOException;
 
-    List<Service> searchServices(final long startTimestamp, final long endTimestamp,
-        final String keyword) throws IOException;
+    /**
+     * @param keyword to filter the normal service
+     * @return the list of normal services matching the given keyword
+     */
+    List<Service> searchServices(final String keyword) throws IOException;
 
+    /**
+     * @param serviceCode to literal match
+     * @return the service matching the given full name.
+     */
     Service searchService(final String serviceCode) throws IOException;
 
+    /**
+     * @param keyword   to filter the endpoints
+     * @param serviceId the owner of the endpoints
+     * @param limit     max match size.
+     * @return list of services matching the given conditions.
+     */
     List<Endpoint> searchEndpoint(final String keyword, final String serviceId, final int limit) throws IOException;
 
+    /**
+     * @param startTimestamp The instance is required to be live after this timestamp
+     * @param endTimestamp   The instance is required to be live before this timestamp.
+     * @param serviceId      the owner of the instances.
+     * @return list of instances matching the given conditions.
+     */
     List<ServiceInstance> getServiceInstances(final long startTimestamp, final long endTimestamp,
-        final String serviceId) throws IOException;
+                                              final String serviceId) throws IOException;
 }
diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
index e76caba..c538a0e 100644
--- a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
+++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java
@@ -62,13 +62,13 @@ public class MetadataQuery implements GraphQLQueryResolver {
         return new ClusterBrief();
     }
 
-    public List<Service> getAllServices(final Duration duration) throws IOException, ParseException {
-        return getMetadataQueryService().getAllServices(duration.getStartTimestamp(), duration.getEndTimestamp());
+    public List<Service> getAllServices(final Duration duration,
+                                        final String group) throws IOException, ParseException {
+        return getMetadataQueryService().getAllServices(group);
     }
 
     public List<Service> getAllBrowserServices(final Duration duration) throws IOException, ParseException {
-        return getMetadataQueryService().getAllBrowserServices(
-            duration.getStartTimestamp(), duration.getEndTimestamp());
+        return getMetadataQueryService().getAllBrowserServices();
     }
 
     public List<Service> searchServices(final Duration duration,
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 92f62f1..cff3d81 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 92f62f13be3a2bf3dfd007ee85c68d54af2c6149
+Subproject commit cff3d817f8b4156d9a28cc1f7c2a8605d444c112
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
index 75894f0..4608143 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/query/MetadataQueryEsDAO.java
@@ -25,6 +25,7 @@ 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.NodeType;
 import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
 import org.apache.skywalking.oap.server.core.analysis.manual.endpoint.EndpointTraffic;
@@ -57,12 +58,15 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> getAllServices(long startTimestamp, long endTimestamp) throws IOException {
+    public List<Service> getAllServices(final String group) throws IOException {
         SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource();
 
         BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
         boolQueryBuilder.must().add(QueryBuilders.termQuery(ServiceTraffic.NODE_TYPE, NodeType.Normal.value()));
-
+        if (StringUtil.isNotEmpty(group)) {
+            boolQueryBuilder.must().add(QueryBuilders.termQuery(ServiceTraffic.GROUP, group));
+        }
+        
         sourceBuilder.query(boolQueryBuilder);
         sourceBuilder.size(queryMaxSize);
 
@@ -72,7 +76,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> getAllBrowserServices(long startTimestamp, long endTimestamp) throws IOException {
+    public List<Service> getAllBrowserServices() throws IOException {
         SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource();
 
         BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
@@ -110,7 +114,7 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> searchServices(long startTimestamp, long endTimestamp, String keyword) throws IOException {
+    public List<Service> searchServices(String keyword) throws IOException {
         SearchSourceBuilder sourceBuilder = SearchSourceBuilder.searchSource();
 
         BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxConstants.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxConstants.java
index 33bc7db..6f749b2 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxConstants.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/InfluxConstants.java
@@ -43,6 +43,8 @@ public interface InfluxConstants {
 
         String NODE_TYPE = "_node_type";
 
+        String GROUP = "_group";
+
         String SERVICE_ID = "_service_id";
     }
 }
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/TableMetaInfo.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/TableMetaInfo.java
index dfd4476..d6be270 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/TableMetaInfo.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/TableMetaInfo.java
@@ -62,8 +62,9 @@ public class TableMetaInfo {
                 || EndpointTraffic.INDEX_NAME.equals(model.getName())) {
                 storageAndTagMap.put(EndpointTraffic.SERVICE_ID, InfluxConstants.TagName.SERVICE_ID);
             } else {
-                // service_traffic  name, node_type
+                // service_traffic  name, node_type, group
                 storageAndTagMap.put(ServiceTraffic.NODE_TYPE, InfluxConstants.TagName.NODE_TYPE);
+                storageAndTagMap.put(ServiceTraffic.GROUP, InfluxConstants.TagName.NODE_TYPE);
             }
         } else {
 
diff --git a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
index ea9a636..8f4b22c 100644
--- a/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
+++ b/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/MetadataQuery.java
@@ -31,6 +31,7 @@ import java.util.Map;
 import java.util.Objects;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.apm.util.StringUtil;
 import org.apache.skywalking.oap.server.core.analysis.NodeType;
 import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
 import org.apache.skywalking.oap.server.core.analysis.manual.endpoint.EndpointTraffic;
@@ -67,12 +68,16 @@ public class MetadataQuery implements IMetadataQueryDAO {
     private final InfluxClient client;
 
     @Override
-    public List<Service> getAllServices(final long startTimestamp, final long endTimestamp) throws IOException {
-        SelectSubQueryImpl<SelectQueryImpl> subQuery = select()
+    public List<Service> getAllServices(final String group) throws IOException {
+        final WhereSubQueryImpl<SelectSubQueryImpl<SelectQueryImpl>, SelectQueryImpl> where = select()
             .fromSubQuery(client.getDatabase())
             .column(ID_COLUMN).column(NAME)
             .from(ServiceTraffic.INDEX_NAME)
-            .where(eq(InfluxConstants.TagName.NODE_TYPE, String.valueOf(NodeType.Normal.value())))
+            .where(eq(TagName.NODE_TYPE, String.valueOf(NodeType.Normal.value())));
+        if (StringUtil.isNotEmpty(group)) {
+            where.where(eq(TagName.GROUP, group));
+        }
+        SelectSubQueryImpl<SelectQueryImpl> subQuery = where
             .groupBy(TagName.NAME, TagName.NODE_TYPE);
         SelectQueryImpl query = select(ID_COLUMN, NAME).from(client.getDatabase());
         query.setSubQuery(subQuery);
@@ -80,7 +85,7 @@ public class MetadataQuery implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> getAllBrowserServices(long startTimestamp, long endTimestamp) throws IOException {
+    public List<Service> getAllBrowserServices() throws IOException {
         WhereQueryImpl<SelectQueryImpl> query = select(ID_COLUMN, NAME)
             .from(client.getDatabase(), ServiceTraffic.INDEX_NAME)
             .where(eq(InfluxConstants.TagName.NODE_TYPE, String.valueOf(NodeType.Browser.value())));
@@ -115,7 +120,7 @@ public class MetadataQuery implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> searchServices(long startTimestamp, long endTimestamp, String keyword) throws IOException {
+    public List<Service> searchServices(String keyword) throws IOException {
         WhereSubQueryImpl<SelectSubQueryImpl<SelectQueryImpl>, SelectQueryImpl> subQuery = select()
             .fromSubQuery(client.getDatabase())
             .column(ID_COLUMN)
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/H2MetadataQueryDAO.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
index a22b14c..6a281ab 100644
--- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
+++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
@@ -29,6 +29,7 @@ import java.sql.SQLException;
 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.NodeType;
 import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
 import org.apache.skywalking.oap.server.core.analysis.manual.endpoint.EndpointTraffic;
@@ -55,12 +56,16 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> getAllServices(long startTimestamp, long endTimestamp) throws IOException {
+    public List<Service> getAllServices(final String group) throws IOException {
         StringBuilder sql = new StringBuilder();
         List<Object> condition = new ArrayList<>(5);
         sql.append("select * from ").append(ServiceTraffic.INDEX_NAME).append(" where ");
         sql.append(ServiceTraffic.NODE_TYPE).append("=?");
         condition.add(NodeType.Normal.value());
+        if (StringUtil.isNotEmpty(group)) {
+            sql.append(ServiceTraffic.GROUP).append("=?");
+            condition.add(group);
+        }
         sql.append(" limit ").append(metadataQueryMaxSize);
 
         try (Connection connection = h2Client.getConnection()) {
@@ -74,7 +79,7 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> getAllBrowserServices(long startTimestamp, long endTimestamp) throws IOException {
+    public List<Service> getAllBrowserServices() throws IOException {
         StringBuilder sql = new StringBuilder();
         List<Object> condition = new ArrayList<>(5);
         sql.append("select * from ").append(ServiceTraffic.INDEX_NAME).append(" where ");
@@ -118,7 +123,7 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
     }
 
     @Override
-    public List<Service> searchServices(long startTimestamp, long endTimestamp, String keyword) throws IOException {
+    public List<Service> searchServices(String keyword) throws IOException {
         StringBuilder sql = new StringBuilder();
         List<Object> condition = new ArrayList<>(5);
         sql.append("select * from ").append(ServiceTraffic.INDEX_NAME).append(" where ");