Setup sentry to only log transactions occuring on a specific subpage

15 Views Asked by At

Is there a way to setup sentry to only monitor transaction occuring on a specific url i.e "www.mypage/newcheckout"?

Let's say I have a next.js based web shop and I'm rolling out a new checkout feature under "www.mypage/newcheckout"

I will be making different requests to various APIs (my own GQL, marketing providers, A/B testing, Paypal, other payment providers etc) and I want to see them all but only if they are being activated on "www.mypage/newcheckout" or it's subdomains like

"www.mypage/newcheckout/paymentproviders"

I've created a sample app, setup different variations of the following in my sentry config files:

 beforeSendTransaction(event) {
    // Modify or drop the event here
    if (event.transaction === "/newcheckout") {
      // send the event to Sentry
      return event;
    }
    return null;
  },

I expected it to only log Errors from the http://localhost:3000/api/sentry-example-api call when I call it from localhost:3000/newcheckout page However when I call it from localhost:3000/otherpage it still shows up in the sentry logs

Im assuming Im misunderstanding how sentry works, and at this point im not even sure whether I can filter out for transactions coming from specific parts of my app. I know I can filter in / out specific api calls like I could ignore api/sentry-example-api, but thats not what I'm after

0

There are 0 best solutions below