-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat:issueless events. Prepare data structures for issueless events #13822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| def group(self): | ||
| from sentry.models import Group | ||
| if not self.group_id: | ||
| return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do consumers of this property check for nulls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not yet. That is my next step since, as of this PR, there is no code path to create an event without a group so we cannot be in a condition where this will return None yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this but I don't have any better ideas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, I think the only way to avoid this is to split events from transactions/traces. But that opens a different conceptual problem. In a world where the event grouping of choice is the incident, what's the future of groups ? Are they going to still exist ?
mitsuhiko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without running the tests or anything this looks good to me.
|
test_featureadoption.py is still failing, fixing it now. |
aa79fab to
c95aaa4
Compare
| organization_id=project.organization_id, | ||
| project_id=project.id, | ||
| group_id=group.id, | ||
| group_id=group.id if group else None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth noting that this will break all of the non-Snuba tagstore implementations (if we haven't already.) We should start putting together a plan to remove the non-Snuba implementations since they'll no longer work correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For issueless events we should not have non-Snuba event at all (even if we are not yet fully there), so by the time we even get to a prototype this should not be a problem.
The plan to remove non Snuba implementation started here :
#13700
in the sense that at least we are querying snuba for events. The further parts of the plan are:
- Remove all the explicit Event.objects.whatever (there are 10-20 of them. Mostly in corner cases)
- Fix all the tests that create event by writing to postgres instead of using the store_event flow
- Address the tagstore implementation
- Clean up the code and remove the feature that allows to skip snuba
|
|
||
| items = [] | ||
| for event in events: | ||
| # TODO: how we index events? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a personal note or what, but probably shouldn't be committed.
In any case, I'm not sure how similarity is going to work with issueless events. For now, my expectation would be that it doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal note. Should not be committed.
And we should never get to this code with issueless events.
src/sentry/signals.py
Outdated
| project_created = BetterSignal(providing_args=["project", "user"]) | ||
| first_event_pending = BetterSignal(providing_args=["project", "user"]) | ||
| first_event_received = BetterSignal(providing_args=["project", "group"]) | ||
| first_event_received = BetterSignal(providing_args=["project", "event", "group"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't group be removed here now that none of the listeners are using/expecting it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right, I got to this after fixing a lot of tests, let me try to remove group entirely
| d = { | ||
| 'id': six.text_type(obj.id), | ||
| 'groupID': six.text_type(obj.group_id), | ||
| 'groupID': six.text_type(obj.group_id) if obj.group_id else None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change obviously has some pretty wide-ranging implications. Not really sure how to give constructive feedback other than pointing out that hopefully everybody who needs to account for this knows the change is coming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too worried other than our UI code breaking. Customers are unlikely to encounter such events as we will not emit webhooks and similar things for issueless events any time soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the breaking change. Overall:
I did an analysis of the impact of groupID and group becoming nullable in several places:
Regarding the backend code, pretty much all the places I found that need the group from the event are unreachable for issueless events. Think about post processing, webhooks, group management code etc. We are not supposed to get there with issueless events.
For what concerns the UI, this is a lot up in the air for now. For what I know so far, the UI over issueless events is different, thank the event details, there are plenty of parts that are conceptually different that would prevent us from reusing the same one even if the group field was not None.
I believe we should eventually have a totally separate data type for issueless events, but this is an open discussion as of now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only UI that should bump into events without groupID is the event list page, and it new implementation. The new implementation is expecting issueless events for the most part. However, we're also missing UI components for transactions/spans which will cause different problems (all solvable though).
| def group(self): | ||
| from sentry.models import Group | ||
| if not self.group_id: | ||
| return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this but I don't have any better ideas.
58197cd to
0286c4e
Compare
This PR prepares the ground for skipping issue creation if the event has no fingerprint by removing some assumption that the group should always exists.
0286c4e to
0732902
Compare
This PR prepares the ground for skipping issue creation if the event has no fingerprint by removing some assumption that the group should always exists.