-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref: No longer prune duplicated data before persisting for future refactorings #10683
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
Changes from all commits
fab2a2e
f66b018
000c740
d034ac5
9a0d6ea
2233623
983d01c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,27 +182,38 @@ def get_tag(self, key): | |
| return v | ||
| return None | ||
|
|
||
| @property | ||
| def release(self): | ||
| return self.get_tag('sentry:release') | ||
|
|
||
| @property | ||
| def dist(self): | ||
| return self.get_tag('sentry:dist') | ||
|
|
||
| def as_dict(self): | ||
| # We use a OrderedDict to keep elements ordered for a potential JSON serializer | ||
| data = OrderedDict() | ||
| data['id'] = self.event_id | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't fully understand the meaning/repercussions of changing this (and the test), can you explain?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is only used in the JSON export. Neither UI nor plugins depend on this. The idea here is to make that output compatible to ingestion, so we can easily take such a payload and process it again, etc
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, got it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you @mitsuhiko @jan-auer for changing this. It definitely annoyed me before that we were using
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Etching ever closer to being able to re-ingest off |
||
| data['event_id'] = self.event_id | ||
| data['project'] = self.project_id | ||
| data['release'] = self.get_tag('sentry:release') | ||
| data['release'] = self.release | ||
| data['dist'] = self.dist | ||
| data['platform'] = self.platform | ||
| data['culprit'] = self.group.culprit | ||
| data['message'] = self.get_legacy_message() | ||
| data['datetime'] = self.datetime | ||
| data['time_spent'] = self.time_spent | ||
| data['tags'] = self.get_tags() | ||
| data['tags'] = [(k.split('sentry:', 1)[-1], v) for (k, v) in self.get_tags()] | ||
| for k, v in sorted(six.iteritems(self.data)): | ||
| if k in data: | ||
| continue | ||
| if k == 'sdk': | ||
| v = {v_k: v_v for v_k, v_v in six.iteritems(v) if v_k != 'client_ip'} | ||
| data[k] = v | ||
|
|
||
| # for a long time culprit was not persisted. In those cases put | ||
| # the culprit in from the group. | ||
| if data.get('culprit') is None: | ||
| data['culprit'] = self.group.culprit | ||
|
|
||
| return data | ||
|
|
||
| @property | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -383,7 +383,7 @@ def save_event(cache_key=None, data=None, start_time=None, event_id=None, | |
|
|
||
| try: | ||
| manager = EventManager(data) | ||
| event = manager.save(project_id) | ||
| event = manager.save(project_id, assume_normalized=True) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is becoming slightly dangerous now because nothing is asserting that only normalized data goes in the queue and all tests will normalize with this. If there is a bug, we can only find it in production. This is not a problem of your change, though it is uncovered now. I just have no idea how to fix this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already the case. |
||
|
|
||
| # Always load attachments from the cache so we can later prune them. | ||
| # Only save them if the event-attachments feature is active, though. | ||
|
|
||
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.
Does it matter that the
event_idandtimestampgetters are becoming safe? They would throw aKeyErrorbefore, and I'm not sure if that would catch anything of value before it caused problems.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.
There is no access to these attributes that would put stuff in.