Repository navigation
feat(issues): Add same trace issues to the related issues endpoint - #130992
Merged
Merged
Conversation
The related issues endpoint gains a same_trace type: issues, in any project the caller can read, with errors in the same trace as the issue's latest event. It reuses trace_connected_issues(), which backs the trace section of the Similar Issues tab, and returns the most recently seen first. When several types find the same issue, it becomes one entry with a relation for each, and issues matched by more types come first.
Christinarlong
marked this pull request as ready for review
November 12, 2026 21:32
scttcper
approved these changes
Nov 12, 2026
Christinarlong
added a commit
that referenced
this pull request
Nov 13, 2026
…131008) - Adds a third relation type, `contributing`, to the `GroupRelated` endpoint. - For a metric issue whose detector counts errors or releases, it returns the issues that match the detector's query during the open period, from most events to least. - This query btw is the same as the `Contributing Issues` section within Metric Issues, but agents have no way to reach that today. The search covers the metric issue's latest open period, starting one detector interval and a minute before it so we can capture the 'triggering' parts. Response example for a metric issue: ```json { "data": [ { "issue": {"id": "...", "shortId": "...", "...": "..."}, "relations": [{"type": "contributing"}] } ], "meta": { "types": [ {"type": "similar_stacktrace", "status": "not_applicable", "detail": "Only error issues have similar stack traces."}, {"type": "same_trace", "status": "ok", "eventId": "60fc17404bf4445c81675be939ef74d6", "traceId": "a7d67cf796774551a95be6543cacd459"}, {"type": "contributing", "status": "ok", "eventId": "60fc17404bf4445c81675be939ef74d6", "start": "2026-11-12T21:43:00+00:00"} ] } } ``` `contributing` is `not_applicable` for issues that aren't metric issues, for detectors on other datasets (spans, logs, transactions), and for detector queries issue search can't run, such as ones with AND or OR. It's `unavailable` when the search fails. Stacked on #130992.
This was referenced Nov 16, 2026
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.
Adds another relation type,
same_trace, toGET /api/0/organizations/{org}/issues/{issue_id}/related/. It returns issues, in any project the caller can read, with errors in the same trace as the issue's latest event.It reuses
trace_connected_issues(), the same lookup behind the trace section of the Similar Issues tab. When both types find the same issue, it becomes one entry, and issues w/ more relationsResponse example
{ "data": [ { "issue": {"id": "...", "shortId": "...", "...": "..."}, "relations": [{"type": "similar_stacktrace", "score": 0.97}, {"type": "same_trace"}] } ], "meta": { "types": [ {"type": "similar_stacktrace", "status": "ok", "eventId": "60fc17404bf4445c81675be939ef74d6"}, {"type": "same_trace", "status": "ok", "eventId": "60fc17404bf4445c81675be939ef74d6", "traceId": "a7d67cf796774551a95be6543cacd459"} ] } }same_traceisnot_applicablewhen the issue has no events. It'sunavailablewhen the trace query fails, and the endpoint still returns 200 as long as another requested type answered.