Conversation
…ues endpoint) from EAP
| result = Occurrences.run_table_query( | ||
| params=snuba_params, | ||
| query_string=f"trace:{trace_id}", | ||
| selected_columns=["group_id", "count()"], |
There was a problem hiding this comment.
Have a count() here in order to get distinct group IDs back
…p-for-related-issues
| gid = int(group_id) | ||
| if gid != exclude_group_id: | ||
| group_ids.add(gid) | ||
| return list(group_ids) |
There was a problem hiding this comment.
Is there any expectation of ordering from this endpoint?
There was a problem hiding this comment.
I don't believe so, since the Snuba implementation also relies on a set. But this does raise a good point in that our Snuba/EAP result comparisons will potentially mismatch even when the group ID sets are the same, since we're comparing the lists instead of the sets. Going to refactor these functions to return the set values so we can check_and_choose on those instead, and then the endpoint can convert to list before returning.
| except Exception: | ||
| logger.exception( | ||
| "Fetching trace connected issues from EAP failed", | ||
| extra={ |
There was a problem hiding this comment.
Can you log the actual exception message as well?
There was a problem hiding this comment.
I believe logger.exception automatically captures the exception value when used in an except block
| projects=projects, | ||
| exclude_group_id=group.id, | ||
| ) | ||
| issues = EAPOccurrencesComparator.check_and_choose( |
There was a problem hiding this comment.
- Is there a way to do a reasonable-comparison here? (EAP subset of Snuba?)
- Can you add is-null-result here?
There was a problem hiding this comment.
Yeah, good idea. I'll refactor to do the exact match comparison using the set versions, and then also add a reasonable match comparator checking if the EAP version is a subset of the Snuba version. And sure, I'll add the is_experimental_data_a_null_result param for when the EAP result is empty.
| @@ -0,0 +1,155 @@ | |||
| from unittest import mock | |||
There was a problem hiding this comment.
Note: I see you've added empty file tests/sentry/issues/related/__init__.py. Is this intentional?
There was a problem hiding this comment.
Yep, I believe necessary for the directory to be picked up as a py module
The
RelatedIssuesEndpointhas logic which can retrieve issues associated with the same trace as the one included in the request. This PR adds logic which uses anEndpointTraceItemTableRPC query to retrieve trace-connected issues.Tested locally to ensure that the reads are succeeding and the results are matching that of the legacy Snuba read path: