You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/05/27 03:07:50 UTC

[skywalking] branch kezhenxu94-patch-1 created (now 53230a6)

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

kezhenxu94 pushed a change to branch kezhenxu94-patch-1
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at 53230a6  Fix wrong service instance id in alarm query

This branch includes the following new commits:

     new 53230a6  Fix wrong service instance id in alarm 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: Fix wrong service instance id in alarm query

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

kezhenxu94 pushed a commit to branch kezhenxu94-patch-1
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit 53230a6f8f32f7cefc49b2acd1a8a0dfb93dbb9a
Author: Zhenxu Ke <ke...@apache.org>
AuthorDate: Thu May 27 11:07:29 2021 +0800

    Fix wrong service instance id in alarm query
---
 .../org/apache/skywalking/oap/query/graphql/resolver/AlarmQuery.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/AlarmQuery.java b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/AlarmQuery.java
index cb63af7..dd531f7 100644
--- a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/AlarmQuery.java
+++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/AlarmQuery.java
@@ -186,15 +186,16 @@ public class AlarmQuery implements GraphQLQueryResolver {
         }
 
         final String service = source.getService();
+        final String serviceId = IDManager.ServiceID.buildId(service, true);
         if (isNullOrEmpty(service)) {
             return "";
         }
 
         final String instance = source.getServiceInstance();
         if (isNullOrEmpty(instance)) {
-            return IDManager.ServiceID.buildId(service, true);
+            return serviceId;
         }
 
-        return IDManager.ServiceInstanceID.buildId(service, instance);
+        return IDManager.ServiceInstanceID.buildId(serviceId, instance);
     }
 }