Skip to content
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(feedback): produce to ingest-feedback-events topic #3344

Merged
merged 28 commits into from
Apr 9, 2024

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Mar 26, 2024

@aliu39 aliu39 requested a review from a team as a code owner March 26, 2024 23:58
@aliu39 aliu39 requested a review from cmanallen March 26, 2024 23:58
@aliu39 aliu39 marked this pull request as draft March 27, 2024 03:21
@Dav1dde
Copy link
Member

Dav1dde commented Mar 27, 2024

You're on a pretty old base for this branch, I recommend updating. The Kafka Topic config recently changed and your change would not work in SaaS.

@aliu39 aliu39 marked this pull request as ready for review March 27, 2024 23:50
@aliu39 aliu39 requested review from cmanallen and Dav1dde April 1, 2024 18:15
@aliu39 aliu39 requested a review from a team April 1, 2024 18:16
@aliu39 aliu39 requested a review from JoshFerge April 1, 2024 18:22
.options
.feedback_ingest_topic_rollout_rate;
let use_feedback_topic =
is_rolled_out(scoping.organization_id, feedback_ingest_topic_rollout_rate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause the rollout load volume to be unbalanced. Large orgs will send significantly more messages than small orgs. This might be okay. Be aware going from 10% -> 20% does not necessarily indicate a 2x increase in volume.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 -> 20 will equal a 2x increase in volume from any given org, right? But not overall.

Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please make sure the consumer side is ready before enabling the feature flag.

consumer = feedback_consumer(timeout=20)
else:
mini_sentry.set_global_config_option("feedback.ingest-topic.rollout-rate", 0.0)
consumer = events_consumer(timeout=20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth also assigning other_consumer and calling .assert_empty() on it at the end of the test.

@@ -199,6 +210,10 @@ impl StoreService {
KafkaTopic::Attachments
} else if event_item.as_ref().map(|x| x.ty()) == Some(&ItemType::Transaction) {
KafkaTopic::Transactions
} else if use_feedback_topic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is_rolled_out is called for every envelope, even if it does not contain a UserReportV2. So I would turn this condition around and evaluate is_rolled_out only when the event type matches.

@aliu39 aliu39 requested a review from jjbayer April 2, 2024 22:17
.current()
.options
.feedback_ingest_topic_rollout_rate;
if is_rolled_out(scoping.organization_id, feedback_ingest_topic_rollout_rate) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is checking the rollout rate with the org, not the event -- let's please roll out slowly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just used as a boolean on/off in practice, so should be fine 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the feedback event volume is, but suddenly going from 0 to N may cause a backlog until consumers scale up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a function I can use to do it on the event level?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably keep it at the org level since feedback volumes aren't that high, and we'd like to test it on all feedback in s4s. Will comment here if that changes. Holding off merging until https://getsentry.atlassian.net/browse/OPS-5543 is done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will probably keep it at the org level since feedback volumes aren't that high

That's totally fine, my comment was just a note to roll out slowly to avoid any surprises 😄

.current()
.options
.feedback_ingest_topic_rollout_rate;
if is_rolled_out(scoping.organization_id, feedback_ingest_topic_rollout_rate) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just used as a boolean on/off in practice, so should be fine 👍

Comment on lines +206 to +210
let feedback_ingest_topic_rollout_rate = self
.global_config
.current()
.options
.feedback_ingest_topic_rollout_rate;
Copy link
Member

@Dav1dde Dav1dde Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit:

Suggested change
let feedback_ingest_topic_rollout_rate = self
.global_config
.current()
.options
.feedback_ingest_topic_rollout_rate;
let global_config = self.global_config.current();
let topic_rollout_rate = global_config.options.feedback_ingest_topic_rollout_rate;

I like splitting this, so it takes up less lines and becomes a bit more readable. But need to check if rustfmt aggrees with me here ...

@aliu39 aliu39 merged commit 01311a4 into master Apr 9, 2024
20 checks passed
@aliu39 aliu39 deleted the aliu/produce-to-feedback-topic branch April 9, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants