hanahmily opened a new issue, #13484: URL: https://github.com/apache/skywalking/issues/13484
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar feature requirement. ### Description Currently, the `QueryResponse` in `api/proto/bany_db/trace/v1/query.proto` returns a **flat list of spans**. This requires clients to manually iterate and group all spans by their `traceID` after receiving the response, which is inefficient and adds unnecessary complexity to client-side logic. This issue proposes refactoring the `QueryResponse` to return spans pre-grouped by their `traceID` from the server. ### Proposed Change The response will be changed from a single list of spans to a list of `Trace` messages. Each `Trace` message will contain a list of spans that all belong to the same trace. The `trace_id` is implicitly shared among all spans within a single `Trace` message. ```protobuf // A message representing a single trace, containing all of its spans. message Trace { repeated Span spans = 1; } // The refactored QueryResponse. message QueryResponse { // Each entry in this list represents a single, complete trace. repeated Trace traces = 1; // trace_query_result contains the trace of the query execution if tracing is enabled. common.v1.Trace trace_query_result = 2; } ``` ### Action Items * Update the message definitions in `api/proto/banyandb/trace/v1/query.proto`. * Update the server-side query implementation to group spans and populate the new structure. * Update the java client code to handle the new `QueryResponse` format. * Update all relevant documentation to reflect the API change. ### Use case _No response_ ### Related issues _No response_ ### Are you willing to submit a pull request to implement this on your own? - [ ] Yes I am willing to submit a pull request on my own! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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-unsubscr...@skywalking.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org