Skip to content

fix(traces): Hide LLM Detected issues from trace details view#109929

Merged
nora-shap merged 3 commits intomasterfrom
nora/ID-1380
Mar 9, 2026
Merged

fix(traces): Hide LLM Detected issues from trace details view#109929
nora-shap merged 3 commits intomasterfrom
nora/ID-1380

Conversation

@nora-shap
Copy link
Member

Summary

Hides LLM Detected issues (still in development) from appearing in the trace details view. These issues were showing up in the span drawer issues panel and as warning icons on span rows.

Additional change: The EAPOccurrence type declared a type field, but the EAP trace endpoint actually sends issue_type. Converted EAPOccurrence's type to issue_type in order to use the value.

Unfortunately, TraceOccurrence = TracePerformanceIssue | EAPOccurrence. TracePerformanceIssue uses type while EAPOccurrence now uses issue_type so using this field on a TraceOccurrence is a bit ugly.

Changes:

  • Rename EAPOccurrence.type to EAPOccurrence.issue_type to match the backend SerializedIssue response
  • Add BaseNode.addOccurrence() method that filters out hidden issue types before adding to the occurrences Set
  • Update all code paths that add occurrences to use addOccurrence() instead of direct .add() calls (except tests)
  • Fix anrRootCause.tsx to handle both type (from older events-trace endpoint) and issue_type (from EAP trace endpoint)

Before (HTTP 5XX Error is an LLM Detected Issue, should be hidden):
Screenshot 2026-03-04 at 5 18 31 PM

After:
Screenshot 2026-03-04 at 6 06 04 PM

@linear-code
Copy link

linear-code bot commented Mar 5, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 5, 2026
@nora-shap nora-shap marked this pull request as ready for review March 5, 2026 18:10
@nora-shap nora-shap requested review from a team as code owners March 5, 2026 18:10
@scttcper scttcper requested a review from Abdkhan14 March 5, 2026 19:26
@nora-shap nora-shap merged commit 7bb7a71 into master Mar 9, 2026
62 checks passed
@nora-shap nora-shap deleted the nora/ID-1380 branch March 9, 2026 17:05
nora-shap added a commit that referenced this pull request Mar 11, 2026
When developing a new performance issue type, we add it with `released =
False`, which allows us to test and calibrate without exposing the
resulting "test issues" to users.

Last week I observed events of unreleased issue types were appearing in
multiple trace-related views in prod:

- Trace waterfall
- Trace preview timeline + "1 other issue" display on issue details
- Event graph in issue details

Users could see issues in traces that should have been hidden.
Unreleased issue types are not returned in `/issues/` api responses, but
the same filtering was not applied to the trace API.

I implemented these 2 prs:
#109857 and
#109929 (which can be reverted
once this is landed, since the changes in this pr are a better and more
broad solution).

## Solution

Add backend filtering to the trace API
(`/organizations/{org}/trace/{trace_id}/`) using the same visibility
system that the issues API uses. The trace query now calls
`grouptype_registry.get_visible(organization)` to filter performance
occurrences by visible issue types, which:

1. Includes all `released=True` issue types
2. Includes unreleased types only if the org has the corresponding
`organizations:issue-{slug}-visible` feature flag enabled

## Changes

- `src/sentry/snuba/trace.py`: Add `organization` param to
`_perf_issues_query` and filter by visible occurrence type IDs
- `src/sentry/api/endpoints/organization_trace.py`: Thread organization
through to the query
- Update all callers (autofix, trace summary, seer explorer) to pass
organization

## Notes

- This only works for performance issues, which have the
`occurrence_type_id` field on the events
- This allows reverting PR #109929 which added frontend filtering as a
stopgap
- The `get_visible()` call is already used in the issues search
endpoint, so performance characteristics are known
- Sentry SDK span already exists for monitoring
(`GroupTypeRegistry.get_visible`)
nora-shap added a commit that referenced this pull request Mar 12, 2026
…110565)

partially reverts #109929 - the
issue type filtering is now done at the api
(#110356) which makes the
frontend filtering redundant.

removes:
- `addOccurrence()` method and its `HIDDEN_OCCURRENCE_TYPE_IDS`
filtering
- The test for `addOccurrence` filtering
- All `addOccurrence()` calls → back to `occurrences.add()`

keeps:
- `EAPOccurrence.issue_type` field name (bug fix)
- anrRootCause.tsx handling of both `type` and `issue_type`
- Unfortunately, `TraceOccurrence` = `TracePerformanceIssue |
EAPOccurrence`. `TracePerformanceIssue` uses `type` while
`EAPOccurrence` now uses `issue_type` so both fields need to be checked
on a `TraceOccurrence`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants