Is it possible to avoid collecting specific data in Sentry?

Viewed 673

when I’m in a sentry issue description page I can see some information collected by the sentry service and I’d like to avoid collecting them to avoid privacy issues.

The information that I’d like to not see are: app.device and user id as you can see here:

enter image description here

Is it possible? I’m concern about new apple privacy restrictions. I don't know if I understood them correctly, but it is necessary to explain to the user, using a pop up or something similar, that the app is using a third party software to collect data about "app crashing" and "app performance". Giving to the user the possibility to choose to not collect those data would bring to developers a lot of headaches. I searched in all project settings and documentation but I found only a way to hide certain tags/data but the point is not hiding information, but not collecting them at all.

Thanks

1 Answers

The 'user.id' that Sentry creates is not an identifier that can be used to track the user across apps or devices. It's a random id created when the app runs for the first time and it's sent with all errors that happens.

The sole goal of this ID is to give the developer an idea of how many different users are affected by an issue. The developer (owner of the app) doesn't know exactly who the user is and if that same users reinstalls the app, a new id is generated so technically Sentry would report all new errors as a new user. Which is fine given the goal is to give an approximation of impact of an issue.

Developers might focus on issues that affect more customer than not.

That said, you can strip data in many ways. Through the SDK or in Sentry itself. If you drop data in Sentry, that is done before the event is written to disk.

Sentry's documentation talks about Scrubbing Sensitive Data here.

Doing it on the SDK side, for example for React Native, you could do:

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  beforeSend(event) {
    // Modify the event here
    if (event.user) {
      // Don't send user id
      delete event.user.id;
    }
    return event;
  },
});

There's also a page talking about Data Privacy in the context of Google and Apple:

https://docs.sentry.io/product/security/mobile-privacy/

Related