-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat(replays): Combined Envelope Items (reopen) #3035
Conversation
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.
Is the goal of this PR purely to unite the two items in the kafka message? If so, I would not introduce a new item type, and implement the entire logic in the kafka producer (store.rs
) instead.
If the goal is to send combined items from relay to relay (in a chain of relays), we need to add support for parsing a combined item and processing it correctly. Right now, I believe such an item would hit this branch and cause an error:
relay/relay-server/src/services/processor.rs
Lines 233 to 235 in 8411b1d
} else { | |
// Cannot group this item type. | |
ProcessingGroup::Ungrouped |
8411b1d
to
6f7433e
Compare
Co-authored-by: Joris Bayer <[email protected]>
@jjbayer @cmanallen I've gone ahead and moved the logic to store -- now the change simply will look for the two replay items, and combine them if if finds them. A couple of questions to ponder:
My general idea here would be to:
If we are able to use project features in store here, that would be more ideal, and also open to suggestions, perhaps we could use S4S if its set up with replays? Any other 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.
@JoshFerge in replay::process
, you have access to project features. So in that function you could set an internal item header similar to this one, and check that item header in store_envelope
.
relay-server/src/services/store.rs
Outdated
let mut replay_event_item = None; | ||
let mut replay_recording_item = 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.
nit: We could declare these variables in store_envelope
, so we don't have to transform to and from a vector.
relay-server/src/services/store.rs
Outdated
@@ -812,6 +834,63 @@ impl StoreService { | |||
Ok(()) | |||
} | |||
|
|||
#[allow(clippy::too_many_arguments)] |
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 what to do about the too many args 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.
Instead of passing replay_event
, replay_recording
, and a boolean flag, the most idiomatic would probably be to pass an enum like
enum Data {
Event(&Item),
Recording(&Item),
Combined { event: &Item, recording: &Item }
}
That would also make states like `(None, None, true)` impossible.
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.
Whoops forgot to publish this review on Friday...
@cmanallen @jjbayer should be good for final review. |
…64948) Adds a feature flag for combining envelope items in relay -- will be used in getsentry/relay#3035. getsentry handler PR will be linked below.
relay-server/src/services/store.rs
Outdated
@@ -812,6 +834,63 @@ impl StoreService { | |||
Ok(()) | |||
} | |||
|
|||
#[allow(clippy::too_many_arguments)] |
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.
Instead of passing replay_event
, replay_recording
, and a boolean flag, the most idiomatic would probably be to pass an enum like
enum Data {
Event(&Item),
Recording(&Item),
Combined { event: &Item, recording: &Item }
}
That would also make states like `(None, None, true)` impossible.
@jjbayer @TBS1996 Josh is out for the rest of the week. I've updated the PR. Please provide final approval. Note: Note: the kafka payload size calculation was reconfigured. I'm using addition rather than subtraction. This is to avoid situations where the replay_event is larger than the maximum size of a recording. This would yield a negative number but since its of type Note: oversized recording messages will now produce an outcome with discard reason |
…e click issues (#65307) if the replay event exists, use that instead of querying clickhouse to create a rage click issue. related:#65291 #65298 getsentry/relay#3035 getsentry/sentry-kafka-schemas#213
Reopening #2170
I've resolved merge conflicts, tests pass, and I believe comments from the previous PR have been addressed.