Fix query `getGlobalTopology` throw exception when didn't find any services by the given Layer. (#12609)

This commit is contained in:
Wan Kai 2024-09-11 14:27:49 +08:00 committed by GitHub
parent 1ff0c57073
commit a71d7ef1f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -61,6 +61,7 @@
* Update the endpoint name format to `<Method>:<Path>` in eBPF Access Log Receiver. * Update the endpoint name format to `<Method>:<Path>` in eBPF Access Log Receiver.
* Add self-observability metrics for OpenTelemetry receiver. * Add self-observability metrics for OpenTelemetry receiver.
* Support service level metrics aggregate when missing pod context in eBPF Access Log Receiver. * Support service level metrics aggregate when missing pod context in eBPF Access Log Receiver.
* Fix query `getGlobalTopology` throw exception when didn't find any services by the given Layer.
#### UI #### UI

View File

@ -130,6 +130,9 @@ public class TopologyQueryService implements Service {
span = traceContext.createSpan("Query Service: getServiceTopology"); span = traceContext.createSpan("Query Service: getServiceTopology");
span.setMsg("Duration: " + duration + ", ServiceIds: " + serviceIds); span.setMsg("Duration: " + duration + ", ServiceIds: " + serviceIds);
} }
if (CollectionUtils.isEmpty(serviceIds)) {
return new Topology();
}
return invokeGetServiceTopology(duration, serviceIds); return invokeGetServiceTopology(duration, serviceIds);
} finally { } finally {
if (traceContext != null && span != null) { if (traceContext != null && span != null) {