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): Emit outcomes for user feedback events #3026

Merged
merged 10 commits into from
Mar 28, 2024

Conversation

cmanallen
Copy link
Member

Adds outcomes for user feedback events.

Should there be test coverage for this? Will this handle failure outcomes? Are there other locations that need configuration?

@cmanallen cmanallen requested a review from a team as a code owner January 30, 2024 17:14
@cmanallen cmanallen changed the title feat(feedback): Add DataCategory for UserReportV2 item type feat(feedback): Emit outcomes for user feedback events Jan 30, 2024
@JoshFerge
Copy link
Member

@cmanallen only other thing -- we'll want to emit an accepted outcome in our create_feedback function in Sentry. and see if there's anywhere else there we'd want to emit filtered / dropped there.

@jjbayer
Copy link
Member

jjbayer commented Jan 31, 2024

Should there be test coverage for this? Will this handle failure outcomes? Are there other locations that need configuration?

@cmanallen yes! Best write an integration test here with all the outcomes you expect and work your way backward from there (we can assist with emitting the outcomes because it's not always obvious).

What outcomes do you actually expect? User feedback is not sampled or filtered AFAIK, Will there be quotas or rate limits for user feedback? Or do you want to collect outcomes for invalid items?

@cmanallen
Copy link
Member Author

@jjbayer

Will there be quotas or rate limits for user feedback? Or do you want to collect outcomes for invalid items?

Yes to both quotas and rate-limits. We should record an outcome for invalid items.

@jjbayer
Copy link
Member

jjbayer commented Mar 1, 2024

@cmanallen is this PR still relevant?

@cmanallen cmanallen closed this Mar 21, 2024
@cmanallen cmanallen reopened this Mar 22, 2024
@cmanallen
Copy link
Member Author

@jjbayer Added a failing test. We just want to emit an outcome when a feedback was rate-limited.

@jjbayer
Copy link
Member

jjbayer commented Mar 25, 2024

Added a failing test. We just want to emit an outcome when a feedback was rate-limited.

@cmanallen Thanks! Unfortunately the rate limiting code is a bit verbose, but you can look at this PR, specifically the files relay-server/src/utils/rate_limits.rs and relay-server/src/utils/managed_envelope.rs to see what changes are needed for a new data type.

@cmanallen
Copy link
Member Author

@jjbayer Added but still failing. Where is the quantity value incremented?

return {
"type": "feedback",
"type": "userreportv2",
Copy link
Member

Choose a reason for hiding this comment

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

This is the name of the event item type, because of

#[serde(rename_all = "lowercase")]

Copy link
Member Author

Choose a reason for hiding this comment

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

According to the coverage in test_feedback.py this is the correct type.

https://github.com/getsentry/relay/blob/master/tests/integration/test_feedback.py#L6

@jjbayer
Copy link
Member

jjbayer commented Mar 26, 2024

@cmanallen I fixed the integration test. I gave you bad advice on the _quantity changes, those are actually not necessary because feedback events are a subtype of events. You can revert them.

@cmanallen cmanallen force-pushed the cmanallen/feedback-report-outcome branch from 0b32be3 to 6deb9a6 Compare March 26, 2024 14:25
@cmanallen
Copy link
Member Author

@jjbayer My mistake I didn't realize you had fixed the code on this branch. In my attempt to fix it on my outdated branch I must have made a typo. You can ignore my earlier comments. I'm still a little confused about the event type. I'm not sure why userreportv2 works and feedback doesn't seeing as its used here: https://github.com/getsentry/relay/blob/master/tests/integration/test_feedback.py#L6.

@jjbayer
Copy link
Member

jjbayer commented Mar 26, 2024

I'm still a little confused about the event type. I'm not sure why userreportv2 works and feedback doesn't seeing as its used here: https://github.com/getsentry/relay/blob/master/tests/integration/test_feedback.py#L6.

I think the linked test works because it sends data to the /envelope endpoint with the correct ItemType. The /store endpoint does not have an item type and looks at the event type instead:

def send_user_feedback(self, project_id, payload):
envelope = Envelope()
envelope.add_item(Item(PayloadRef(json=payload), type="feedback"))

@cmanallen
Copy link
Member Author

@jjbayer Makes sense. So this rate-limiting outcome will be emitted for requests to the /envelope endpoint?

@jjbayer
Copy link
Member

jjbayer commented Mar 27, 2024

@jjbayer Makes sense. So this rate-limiting outcome will be emitted for requests to the /envelope endpoint?

@cmanallen it will work for the /store endpoint as well, but the /store endpoint requires the userreportv2 event type in the payload.

@cmanallen
Copy link
Member Author

@jjbayer I'm unfamiliar with this product but I'm pretty sure we use the envelope endpoint to submit feedback. As long as it works there with the feedback type I'm happy :D

@cmanallen
Copy link
Member Author

@jjbayer Is this ready (can be approved) or is there more work to do?

@cmanallen cmanallen merged commit 311b237 into master Mar 28, 2024
20 checks passed
@cmanallen cmanallen deleted the cmanallen/feedback-report-outcome branch March 28, 2024 15:34
jan-auer added a commit that referenced this pull request Apr 3, 2024
* master:
  feat(metric-stats): Report cardinality to metric stats (#3360)
  release: 0.8.56
  fix(perfscore): Adds span op tag to perf score totals (#3326)
  ref(profiles): Return retention_days as part of the Kafka message (#3362)
  ref(filter): Add GTmetrix to the list of web crawlers (#3363)
  fix: Fix kafka topic default (#3350)
  ref(normalization): Remove duplicated normalization (#3355)
  feat(feedback): Emit outcomes for user feedback events (#3026)
  feat(cardinality): Implement cardinality reporting (#3342)
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.

3 participants