-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(user_report): Treat UserReport like standalone attachment #2984
Conversation
@@ -110,10 +110,11 @@ pub enum ProcessingGroup { | |||
Error, | |||
/// Session events. | |||
Session, | |||
/// Attachments which can be sent alone without any event attached to it in the current | |||
/// Attachments (including UserReports) which can be sent alone without any event attached to it in the current |
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.
Would it make sense to have a separate group of StandaloneUserReport
?
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 user reports are sent to the attachment kafka topic as well, and from what I understood we treat them like attachments, so the group name kind of reflects the purpose, I think.
But maybe @jan-auer correct me here and provide a little bit more context here.
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.
Makes sense 👍
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.
Maybe we should simply rename this group. This is a group of standalone items that belong to events. Not sure what the best concise name is, but effectively everything that has requires_event() = true
while there's no event in the envelope has to go in there.
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.
Done and renamed it to Standalone
for now.
CHANGELOG.md
Outdated
@@ -13,7 +13,7 @@ | |||
|
|||
- Add automatic PII scrubbing to `logentry.params`. ([#2956](https://github.com/getsentry/relay/pull/2956)) | |||
- Avoid producing `null` values in metric data. These values were the result of Infinity or NaN values extracted from event data. The values are now discarded during extraction. ([#2958](https://github.com/getsentry/relay/pull/2958)) | |||
- Process user reports in separate processing group. ([#2981](https://github.com/getsentry/relay/pull/2981)) | |||
- Add user reports to a correct processing group. ([#2981](https://github.com/getsentry/relay/pull/2981), [#2984](https://github.com/getsentry/relay/pull/2984)) |
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.
nit: "separate" seems more explicit than "correct", could we find another term to make the changelog a bit more clear?
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 will think about this a bit hot to rephrase it.
// Note: only if there is no items in the envelope which can create events. | ||
// Extract all standalone attachments and reports. | ||
// | ||
// Note: only if there is no items in the envelope which can create events, otherwise they |
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.
// Note: only if there is no items in the envelope which can create events, otherwise they | |
// Note: only if there are no items in the envelope which can create events, otherwise they |
|
||
event_id = uuid.uuid1().hex | ||
|
||
error_payload = { |
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 we could benefit from a test where the error is dropped but not the user report, what do you think?
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.
That's might be good, what condition do you have in mind for this to happen?
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.
Sending an incorrect error should be good enough; but alternatively, send an error that's filtered out by e.g. inbound filters. The user report should be consumed in both cases.
@@ -110,10 +110,11 @@ pub enum ProcessingGroup { | |||
Error, | |||
/// Session events. | |||
Session, | |||
/// Attachments which can be sent alone without any event attached to it in the current | |||
/// Attachments (including UserReports) which can be sent alone without any event attached to it in the current |
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.
Maybe we should simply rename this group. This is a group of standalone items that belong to events. Not sure what the best concise name is, but effectively everything that has requires_event() = true
while there's no event in the envelope has to go in there.
matches!(item.ty(), &ItemType::Attachment | &ItemType::FormData) | ||
matches!( | ||
item.ty(), | ||
&ItemType::Attachment | &ItemType::FormData | &ItemType::UserReport |
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.
Can we replace this with requires_event
to prevent future items missing here?
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.
Done
/// envelope. | ||
StandaloneAttachment, | ||
UserReport, | ||
/// Outcomes. | ||
ClientReport, | ||
Replay, |
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.
While we're at it, could we add docs to the remaining group variants and fix typos in the existing docs?
/// Unknown item types will be forwarded upstream (to processing Relay), where we will
/// decide what to do with it.
ForwardUnknown,
/// All the items in the envelope that could not be grouped.
Ungrouped,
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.
fixed I think 😄 thanks for pointing this out
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.
Looks good, thank you for applying the suggestions!
In a follow-up, we can clarify the semantics of creates_event
and requires_event
, and consider better alternatives to these functions. They do not live up to today's needs anymore.
If the user reports are send in separate envelope from the event, we treat it like a standalone attachment.
fix: #2980