fix(traces): Hide LLM Detected issues from trace details view#109929
Merged
fix(traces): Hide LLM Detected issues from trace details view#109929
Conversation
scttcper
approved these changes
Mar 9, 2026
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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
EAPOccurrencetype declared atypefield, but the EAP trace endpoint actually sendsissue_type. ConvertedEAPOccurrence'stypetoissue_typein order to use the value.Unfortunately,
TraceOccurrence = TracePerformanceIssue | EAPOccurrence.TracePerformanceIssueusestypewhileEAPOccurrencenow usesissue_typeso using this field on aTraceOccurrenceis a bit ugly.Changes:
EAPOccurrence.typetoEAPOccurrence.issue_typeto match the backendSerializedIssueresponseBaseNode.addOccurrence()method that filters out hidden issue types before adding to the occurrences SetaddOccurrence()instead of direct.add()calls (except tests)anrRootCause.tsxto handle bothtype(from older events-trace endpoint) andissue_type(from EAP trace endpoint)Before (

HTTP 5XX Erroris an LLM Detected Issue, should be hidden):After:
