You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/05/03 08:36:05 UTC

[GitHub] [skywalking] chenmudu commented on a change in pull request #6888: Include event(s) to alarms.

chenmudu commented on a change in pull request #6888:
URL: https://github.com/apache/skywalking/pull/6888#discussion_r624950393



##########
File path: oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/AlarmQuery.java
##########
@@ -62,11 +83,111 @@ public Alarms getAlarm(final Duration duration, final Scope scope, final String
         }
         long startSecondTB = 0;
         long endSecondTB = 0;
+        EventQueryCondition condition = new EventQueryCondition();
         if (nonNull(duration)) {
             startSecondTB = duration.getStartTimeBucketInSec();
             endSecondTB = duration.getEndTimeBucketInSec();
+            condition.setTime(duration);
+        }
+        Alarms alarms = getQueryService().getAlarm(
+                scopeId, keyword, paging, startSecondTB, endSecondTB, tags);
+        Events events = null;
+        try {
+            events = getEventQueryService().queryEvents(condition);
+        } catch (Throwable e) {
+            LOGGER.error(e.getMessage(), e);
+            return alarms;

Review comment:
       So I'm going to go up to the `GraphQLQueryHandler` to catch it, so that's the right thing to do, right?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org