Skip to content

feat(feedback): produce to ingest-feedback-events topic#3344

Merged
aliu39 merged 28 commits intomasterfrom
aliu/produce-to-feedback-topic
Apr 9, 2024
Merged

feat(feedback): produce to ingest-feedback-events topic#3344
aliu39 merged 28 commits intomasterfrom
aliu/produce-to-feedback-topic

Conversation

@aliu39
Copy link
Copy Markdown
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
Copy Markdown
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 Dav1dde and cmanallen 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

KafkaTopic::Attachments
} else if event_item.as_ref().map(|x| x.ty()) == Some(&ItemType::Transaction) {
KafkaTopic::Transactions
} else if use_feedback_topic
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 ...

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