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(on-demand): Extend support fields in the event getter #2640

Merged
merged 7 commits into from
Oct 23, 2023

Conversation

iambriccardo
Copy link
Member

@iambriccardo iambriccardo commented Oct 20, 2023

This PR adds support for additional fields in the Event Getter implementation in order to satisfy a wider range of conditions for on-demand metrics.

In addition, it adds the following new fields to the DeviceContext:

  • locale
  • screen_height_pixels
  • screen_width_pixels
  • uuid

Closes getsentry/sentry#58504

@iambriccardo iambriccardo marked this pull request as ready for review October 20, 2023 12:15
@iambriccardo iambriccardo requested a review from a team October 20, 2023 12:15
Comment on lines +165 to +167
/// Width of the screen in pixels.
#[metastructure(pii = "maybe")]
pub screen_width_pixels: Annotated<u64>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this property having pii make sense? Same for the fields below.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about this, and I was like, maybe some people want to scrape those fields, since they might not want to share that information with sentry (e.g., a new device with a new resolution is being secretly tested), maybe the UUID is the only thing but also that can be delicate for some users. We can definitely omit it, idk if there is a performance overhead to this.

Copy link
Member

@jan-auer jan-auer Oct 23, 2023

Choose a reason for hiding this comment

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

I'd rather not mark them PII. They are not, and none of the other fields are marked as such.
The screen size is not PII, however since the other screen attributes are marked as PII, we should stay consistent here.

CHANGELOG.md Outdated
@@ -12,6 +12,7 @@
- Restrict resource spans to script and css only. ([#2623](https://github.com/getsentry/relay/pull/2623))
- Postpone metrics aggregation until we received the project state. ([#2588](https://github.com/getsentry/relay/pull/2588))
- Scrub random strings in resource span descriptions. ([#2614](https://github.com/getsentry/relay/pull/2614))
- Extend the number of supported fields for the `Event` `Getter`. ([#2640](https://github.com/getsentry/relay/pull/2640))
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR extends the event schema. Could we move this to the features section, and also update the py/changelog?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure

@iambriccardo iambriccardo enabled auto-merge (squash) October 23, 2023 07:36
@iambriccardo iambriccardo merged commit 64a42ae into master Oct 23, 2023
20 checks passed
@iambriccardo iambriccardo deleted the riccardo/feat/extend-event-getter branch October 23, 2023 07:45
jan-auer added a commit that referenced this pull request Oct 23, 2023
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

The following fields are missing in this PR:

  • contexts.app.in_foreground
  • contexts.unreal.crash_type

I'll rebase #2607 and address these.

Comment on lines +165 to +167
/// Width of the screen in pixels.
#[metastructure(pii = "maybe")]
pub screen_width_pixels: Annotated<u64>,
Copy link
Member

@jan-auer jan-auer Oct 23, 2023

Choose a reason for hiding this comment

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

I'd rather not mark them PII. They are not, and none of the other fields are marked as such.
The screen size is not PII, however since the other screen attributes are marked as PII, we should stay consistent here.

screen_dpi: Annotated::new(560),
screen_width_pixels: Annotated::new(1920),
screen_height_pixels: Annotated::new(1080),
locale: Annotated::new("US".into()),
Copy link
Member

Choose a reason for hiding this comment

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

A correct value for this field would be en-US or de-AT.

#[metastructure(pii = "maybe")]
pub screen_height_pixels: Annotated<u64>,

/// Locale of the device.
Copy link
Member

Choose a reason for hiding this comment

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

Let's try to add more information to the doc comments, such as what is the format. I'll pick this up in my follow-up.

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.

Adding fields support in Relay
3 participants