Conversation
…ted_groups` monitors function
…tors-fetch-associated-groups
src/sentry/monitors/utils.py
Outdated
| trace_ids: list[str], organization_id: int, project_id: int, start: datetime, end: datetime | ||
| ) -> dict[str, list[dict[str, int | str]]]: | ||
| """ | ||
| Returns serializer appropriate group_ids corresponding with check-in trace ids. |
There was a problem hiding this comment.
Nit: What does serializer appropriate mean here?
There was a problem hiding this comment.
Just that there's some formatting of the data on top that the serializer (caller for this function) expects. Will update this comment to clarify
tests/sentry/monitors/test_utils.py
Outdated
| assert result == {} | ||
|
|
||
|
|
||
| class FetchAssociatedGroupsDoubleReadTest(TestCase): |
There was a problem hiding this comment.
Same mocking question here - How do we know any of this works if it's all mocked?
There was a problem hiding this comment.
yeah, these tests are really just for the sentry side of things (structuring the eap query + testing that the double reads with snuba execute as expected), not meant to be e2e tests against an actual eap backend.
agreed we should have those tho, it's on my todo list to get occurrences supported in SnubaTestCase
There was a problem hiding this comment.
Updated the tests, e2e now
…tors-fetch-associated-groups
| return dict(group_id_data) | ||
|
|
||
|
|
||
| def _fetch_associated_groups_eap( |
There was a problem hiding this comment.
Note: this query is doing essentially the same thing as what's implemented in src/sentry/issues/related/trace_connected.py (get groups associated with some trace IDs). As a potential follow-up item: implement a higher-level query in src/sentry/search/eap/occurrences/common_queries.py that both src/sentry/issues/related/trace_connected.py & src/sentry/monitors/utils.py (and src/sentry/api/endpoints/organization_events_trace.py and likely other callsites) can rely on.
Self-note: look for any other possible abstractions as well, as we continue migrating more read paths.
Implements double reads of occurrences from EAP for
fetch_associated_groupsinsrc/sentry/monitors/utils.py.