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

discard ui.action.click transactions #383

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ Sentry.init({

return event;
},
beforeSendTransaction(event) {
// ui.action.click transactions are showing up in the demo
// which is undesirable
if (event?.contexts?.trace?.op === 'ui.action.click') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this too general? Is it a bad thing if we filter out ALL ui.action.click transactions?

Copy link
Contributor

Choose a reason for hiding this comment

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

@cstavitsky I believe we since un-did the Experiment for transactions from UI clicks but here's my take on this.

I'm a believer that if no one is specifically using ui.action.click transactions, then no, it's not a problem to remove them. When we adopt Beta's and Experiments for the sake of padding our demo data with more data, without a clear defined benefit, then it's opening us up to risk of interference in unforeseen ways.

console.log('> Deliberately discarding ui.action.click event');
return null;
}
return event;
},
});

// TODO is this best placement?
Expand Down Expand Up @@ -255,17 +264,19 @@ class App extends Component {
// Automatically append `se`, `customerType` and `userEmail` query params to all requests
// (except for requests to Sentry)
const nativeFetch = window.fetch;
window.fetch = function(...args) {
window.fetch = function (...args) {
let url = args[0];
// When TDA is run in 'mock' mode inside Docker mini-relay will be ingesting on port 9989, see:
// https://github.com/sentry-demos/empower/blob/79bed0b78fb3d40dff30411ef26c31dc7d4838dc/mini-relay/Dockerfile#L9
let ignore_match = url.match(/^http[s]:\/\/([^.]+\.ingest\.sentry\.io\/|localhost:9989|127.0.0.1:9989).*/);
let ignore_match = url.match(
/^http[s]:\/\/([^.]+\.ingest\.sentry\.io\/|localhost:9989|127.0.0.1:9989).*/
);
if (!ignore_match) {
Sentry.withScope(function (scope) {
let se, customerType, email;
[se, customerType] = [scope._tags.se, scope._tags.customerType];
email = scope._user.email;
args[1].headers = {...args[1].headers, se, customerType, email};
args[1].headers = { ...args[1].headers, se, customerType, email };
});
}
return nativeFetch.apply(window, args);
Expand Down