Scrubbing personal data from Sentry performance traces

Hi all, I am using the JavaScript SDK (@sentry/react v6.5.1) and am enabling performance monitoring for my React app.

The organisation I work at has strict compliance standards and our systems are not allowed to store personally-identifiable data (PII) in third-parties.

I use Sentry’s beforeSend to remove PII from errors and it works well. Is there an equivalent for traces which has the same ability to modify traces before they are uploaded over the Internet? The data that needs to be scrubbed, as an example, may appear in URLs as part of a trace.