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): add User Feedbacks as Events #2604

Merged
merged 25 commits into from
Oct 30, 2023
Merged

feat(feedback): add User Feedbacks as Events #2604

merged 25 commits into from
Oct 30, 2023

Conversation

JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Oct 13, 2023

Relay changes for the revamped User Feedback feature. User Feedbacks (Known as UserFeedbackV2), will be events that flow through our system instead of attachments. See here for more information on the tech spec (and the link at the bottom for what we do once they're ingested).

Note that within this code, we're calling it UserReportV2. This is to avoid confusion with the existing UserReport. A PR to shim the previous UserReports as new UserReportV2's will follow, at which point we'll rename this in the code to be UserFeedback. The string feedback is used for the context and ItemType / EventType parsing.

  • Adds a feature flag for ingest UserReportV2Ingest. This is backed by options https://github.com/getsentry/getsentry/issues/11573
  • Creates a new EventType UserReportV2
  • Creates a new ItemType UserReportV2
  • Creates a new DataCategory UserReportV2
  • Adds a new context UserReportV2Context that for now contains two properties, contact_email (no pii stripping), and the message which contains the feedback text.

@JoshFerge JoshFerge changed the title Jferg/feedback feat(feedback): add User Feedbacks as Events Oct 13, 2023
@JoshFerge JoshFerge marked this pull request as ready for review October 13, 2023 06:29
@JoshFerge JoshFerge requested a review from a team October 13, 2023 06:29
Copy link
Contributor

@iker-barriocanal iker-barriocanal left a comment

Choose a reason for hiding this comment

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

Leaving some questions/points from a preliminary review:

  • Since we're adding a new data category, we should update the C ABI headers -- make header in relay-cabi should work. We should also update the py/Changelog.
  • What's the plan for current feedback items that live as attachments?
  • Should these new feedback items go into a new Kafka topic?
  • See my comment below on UserReport -> UserFeedback transition.

@@ -108,6 +114,7 @@ impl DataCategory {
Self::Monitor => "monitor",
Self::Span => "span",
Self::MonitorSeat => "monitor_seat",
Self::UserReportV2 => "user_report_v2",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also update the from_name function above.

relay-base-schema/src/events.rs Outdated Show resolved Hide resolved
Comment on lines +63 to +65
/// Currently standardized on name UserReportV2 to avoid clashing with the old UserReport.
/// TODO(jferg): Rename this to UserFeedback once old UserReport is deprecated.
UserReportV2 = 14,
Copy link
Contributor

Choose a reason for hiding this comment

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

Depending on when UserReport -> UserFeedback transition happens, we may need to support both alternatives to avoid future breaking changes. Have we considered this? Is there any ETA on the deprecation?

Copy link
Member

Choose a reason for hiding this comment

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

Why not use UserFeedback right away? I agree with Iker that renaming later could bring extra complexity and possible compatibility issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

when discussing with @jan-auer over initial call, he called out to not have it so there are "synonyms" in the code. I can change to UserFeedback if that is preferred.

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 more important than the internal naming is making sure that the serialized string representations in the public interface do not have to be changed, e.g "user_report_v2" for the data category.

The internal names of the types are less important, but I did a case insensitive search for "feedback" and found only a few references in comments, so I would personally go for the new naming straight away, but I'll leave it up to you. cc @jan-auer

relay-dynamic-config/src/feature.rs Outdated Show resolved Hide resolved
@@ -27,6 +27,7 @@ pub use reprocessing::*;
pub use response::*;
pub use runtime::*;
pub use trace::*;
pub use user_report_v2::*;
Copy link
Contributor

Choose a reason for hiding this comment

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

* exports above aren't ideal, could we only export the types we need?

Copy link
Member Author

Choose a reason for hiding this comment

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

should i include that refactor in this PR, or could I follow up with that? not sure how you all like to split changes like that into separate PRs or not.

relay-server/src/actors/processor.rs Show resolved Hide resolved
@@ -546,6 +551,7 @@ impl Item {
ItemType::Statsd | ItemType::MetricBuckets => None,
ItemType::FormData => None,
ItemType::UserReport => None,
ItemType::UserReportV2 => None,
Copy link
Contributor

Choose a reason for hiding this comment

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

This means no outcomes will be generated. Is this intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

for now, yes. will change this once we have data flowing through system and we're closer to alpha etc.

Comment on lines +63 to +65
/// Currently standardized on name UserReportV2 to avoid clashing with the old UserReport.
/// TODO(jferg): Rename this to UserFeedback once old UserReport is deprecated.
UserReportV2 = 14,
Copy link
Member

Choose a reason for hiding this comment

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

Why not use UserFeedback right away? I agree with Iker that renaming later could bring extra complexity and possible compatibility issues.

relay-base-schema/src/events.rs Show resolved Hide resolved
relay-server/src/actors/processor.rs Show resolved Hide resolved
relay-base-schema/src/data_category.rs Show resolved Hide resolved
JoshFerge and others added 3 commits October 23, 2023 16:47
Co-authored-by: Iker Barriocanal <32816711+iker-barriocanal@users.noreply.github.com>
Co-authored-by: Iker Barriocanal <32816711+iker-barriocanal@users.noreply.github.com>
@JoshFerge
Copy link
Member Author

  • Since we're adding a new data category, we should update the C ABI headers -- make header in relay-cabi should work. We should also update the py/Changelog.

done.

  • What's the plan for current feedback items that live as attachments?

see PR description:

A PR to shim the previous UserReports as new UserReportV2's will follow, at which point we'll rename this in the code to be UserFeedback.

  • Should these new feedback items go into a new Kafka topic?

No -- we'll process them in our ingest consumer conditioned on the event type. this was chosen over a separate Kafka topic in conversation w/ @jan-auer last week.

  • See my comment below on UserReport -> UserFeedback transition.

Replied, when Jan and I spoke, there was a decision to avoid synonyms in the code. can change if ya'll would like -- I don't have a strong opinion here. also see PR description:

at which point we'll rename this in the code to be UserFeedback

Copy link
Contributor

@iker-barriocanal iker-barriocanal left a comment

Choose a reason for hiding this comment

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

Pending the relay-cabi update, LGTM. Thanks a lot for working on this PR!

CHANGELOG.md Outdated
@@ -30,6 +30,7 @@
- Accept spans needed for the mobile Starfish module. ([#2570](https://github.com/getsentry/relay/pull/2570))
- Extract size metrics and blocking status tag for resource spans. ([#2578](https://github.com/getsentry/relay/pull/2578))
- Add a setting to rollout ingesting all resource spans. ([#2586](https://github.com/getsentry/relay/pull/2586))
- Add User Feedback Ingestion. ([#2604](https://github.com/getsentry/relay/pull/2604))
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also update py/changelog

Copy link
Member

Choose a reason for hiding this comment

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

Also, please move this to the ## Unreleased section at the top of this file.

py/CHANGELOG.md Outdated
- Remove event breadcrumbs dating before January 1, 1970 UTC. ([#2635](https://github.com/getsentry/relay/pull/2635))
- Add `locale` ,`screen_width_pixels`, `screen_height_pixels`, and `uuid` to the device context. ([#2640](https://github.com/getsentry/relay/pull/2640))
- Add `scraping_attempts` field to the event schema.
([#2575](https://github.com/getsentry/relay/pull/2575))
Copy link
Member

Choose a reason for hiding this comment

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

Did the autoformatter run wild here?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed! not sure why my markdown formatter does this.

relay-event-schema/src/protocol/contexts/user_report_v2.rs Outdated Show resolved Hide resolved
@JoshFerge JoshFerge requested a review from jjbayer October 25, 2023 17:12
@JoshFerge
Copy link
Member Author

@iker-barriocanal could you take a look again? need your approval since you requested changes.

@@ -108,6 +114,7 @@ impl DataCategory {
Self::Monitor => "monitor",
Self::Span => "span",
Self::MonitorSeat => "monitor_seat",
Self::UserReportV2 => "feedback",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add this string to the from_name above before merging, otherwise Relay won't recognize the data category when deserializing.

@JoshFerge JoshFerge merged commit 20f72be into master Oct 30, 2023
20 checks passed
@JoshFerge JoshFerge deleted the jferg/feedback branch October 30, 2023 18:30
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