You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wankai123 (via GitHub)" <gi...@apache.org> on 2025/07/29 01:07:04 UTC

[PR] GraphQL API: metadata, topology, log and trace support query by name. [skywalking]

wankai123 opened a new pull request, #13388:
URL: https://github.com/apache/skywalking/pull/13388

   - [X] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #12761.
   - [X] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] GraphQL API: metadata, topology, log and trace support query by name. [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #13388:
URL: https://github.com/apache/skywalking/pull/13388


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] GraphQL API: metadata, topology, log and trace support query by name. [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #13388:
URL: https://github.com/apache/skywalking/pull/13388#discussion_r2238615633


##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/TopologyQueryService.java:
##########
@@ -193,6 +198,17 @@ public ServiceInstanceTopology getServiceInstanceTopology(final String clientSer
                 span = traceContext.createSpan("Query Service: getServiceInstanceTopology");
                 span.setMsg("ClientServiceId: " + clientServiceId + ", ServerServiceId: " + serverServiceId + ", Duration: " + duration);
             }
+            //check if the service exists, the unreal service do not check

Review Comment:
   ```suggestion
               //check the service existence exclude unreal services.
   ```
   



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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


Re: [PR] GraphQL API: metadata, topology, log and trace support query by name. [skywalking]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13388:
URL: https://github.com/apache/skywalking/pull/13388#discussion_r2238102801


##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/TopologyQueryService.java:
##########
@@ -204,6 +209,7 @@ public ServiceInstanceTopology getServiceInstanceTopology(final String clientSer
     private ServiceInstanceTopology invokeGetServiceInstanceTopology(final String clientServiceId,
                                                               final String serverServiceId,
                                                               final Duration duration) throws IOException {
+        //todo: check service id?

Review Comment:
   The TODO comment should be addressed or removed. If service ID validation is needed here (similar to the validation added in getServiceTopology), it should be implemented consistently.
   ```suggestion
           if (StringUtil.isEmpty(clientServiceId) || StringUtil.isEmpty(serverServiceId)) {
               throw new IllegalArgumentException("Service IDs must not be null or empty. ClientServiceId: " + clientServiceId + ", ServerServiceId: " + serverServiceId);
           }
   ```



##########
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/TopologyQuery.java:
##########
@@ -96,6 +99,28 @@ public Topology getServiceTopology(final String serviceId,
         }
     }
 
+    public Topology getServiceTopologyByName(final ServiceCondition service,
+                                             final Duration duration,
+                                             final boolean debug) {
+        DebuggingTraceContext traceContext = new DebuggingTraceContext(
+            "Service: " + service + "Duration: " + duration, debug, false);
+        DebuggingTraceContext.TRACE_CONTEXT.set(traceContext);
+        DebuggingSpan span = traceContext.createSpan("Query service topology");
+        try {
+            List<String> selectedServiceList = new ArrayList<>(1);
+           selectedServiceList.add(service.getServiceId());

Review Comment:
   [nitpick] There's inconsistent spacing in the indentation. The line should be properly aligned with the surrounding code.
   ```suggestion
               selectedServiceList.add(service.getServiceId());
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

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