Trace query returns empty results when combining Status (Error) filter with Endpoint filter in both Native UI and TraceQL
bugdatabase
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
### Apache SkyWalking Component
OAP server (apache/skywalking)
### What happened
When querying traces with both the "Status = Error" filter and an endpoint name filter applied simultaneously, the query returns zero results — even though traces matching both criteria exist in the system.
This is reproducible in two ways:
1. SkyWalking Native UI: Selecting a service, then setting both the endpoint filter (e.g. "POST:/event/sync") and the status filter to "Error" at the same time returns no results.
2. Tempo-compatible TraceQL API (via Grafana): The following queries behave inconsistently:
Works — returns 3 error traces:
{ resource.service.name = "logger-producer-server" && status = error }
Works — returns 4 traces (3 errors + 1 success, incorrect):
{ resource.service.name = "logger-producer-server" && name = "POST:/event/sync" }
Returns empty — should return 3 error traces:
{ resource.service.name = "logger-producer-server" && name = "POST:/event/sync" && status = error }
The issue appears to be in how the OAP backend intersects the `isError` flag condition with the endpoint name condition at the storage query level.
<img width="1743" height="748" alt="Image" src="https://github.com/user-attachments/assets/d9bc87f7-287d-4dec-ab49-adcd6bfe85a6" />
<img width="1753" height="673" alt="Image" src="https://github.com/user-attachments/assets/c050d245-6c96-470a-bb65-06702e176b9f" />
<img width="1756" height="664" alt="Image" src="https://github.com/user-attachments/assets/c5a5d4db-094c-4ccc-88c2-f6ae69178a56" />
### What you expected to happen
When both the endpoint filter and the error status filter are applied together, the query should return only the traces that match both conditions — i.e. traces from the specified endpoint that also have isError = true.
In the scenario above, exactly 3 traces were expected (the 3 failed requests to POST:/event/sync), not 0.
### How to reproduce
1. Instrument a Spring Boot service with the SkyWalking Java agent (version compatible with OAP 10.4.0).
2. Send a mix of successful and failing HTTP requests to the same endpoint (e.g. POST /event/sync).
In this case: 3 requests returning HTTP 500, 1 request returning HTTP 200.
3. Open SkyWalking Native UI → Trace page.
4. Select the service (e.g. "logger-producer-server").
5. Set the endpoint filter to "POST:/event/sync".
6. Set the status filter to "Error".
7. Run the query → Result: 0 traces returned.
8. To confirm the data exists:
- Clear the endpoint filter, keep only Status = Error → 3 traces returned correctly.
- Clear the status filter, keep only the endpoint filter → 4 traces returned (3 error + 1 success).
- Both filters together → 0 traces.
Alternatively, reproduce via TraceQL on the Tempo-compatible API:
{ resource.service.name = "logger-producer-server" && name = "POST:/event/sync" && status = error }
→ Returns empty.
### Anything else
_No response_
### Are you willing to submit a pull request to fix 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)
关闭于 2026-04-06 1 条评论