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

Unexpected behavior with new ignore_transactionsconfig option released in 3.17.0 #1509

Closed
stevenwoodson opened this issue Mar 31, 2023 · 3 comments

Comments

@stevenwoodson
Copy link

How do you use Sentry?

Sentry Saas (sentry.io)

Version

3.17.0

Steps to Reproduce

Huge thank you again to @cleptric for adding ignore_transactions in #1503, this report is about one anomaly I'm seeing after updating to use it.

My updated code:
'ignore_transactions' => ['GET /buddy', 'GET /heartbeat'],

Details on these two transactions I'm ignoring:

  • /buddy is a basic "is my site still online" GET request going to a simple Laravel view, pinged via an external monitor. This one continues to be ignored as expected.
  • /heartbeat is through a package called Caffeine for Laravel that performs an XHR GET requests from an already loaded page to ensure the logged in user doesn't time out while filling out the form. It returns a 202 Accepted status code. This one is no longer being ignored.

After a bit of fiddling I'm speculating that it may have to do with the fact that the request is coming in via an XHR request and not a standard browser HTTP request, though I don't understand the internals of this enough to know for sure. I can confirm that the URL and the request method is right, in my transaction summary I see /heartbeat and the method is indeed GET.

Expected Result

All transactions added to the ignore_transactions configuration is ignored.

Actual Result

Some transactions are currently not being ignored, possibly due to being an XHR request.

@stayallive
Copy link
Collaborator

stayallive commented Mar 31, 2023

Are you sure that the transaction names are correct, you are reporting here in the PHP SDK repository so you would be setting your transaction names "manually" so they could very well be but you also mention Laravel, in our framework SDKs we call our transactions just /heartbeat for example and the request method is metadata and not part of the transaction name.

We test ignore_transactions against the transaction name (Laravel or you would have setup when starting the transaction). So depending on what you did there exactly this might be the cause and you might need to change to 'ignore_transactions' => ['/buddy', '/heartbeat'], to make it work?

@cleptric
Copy link
Member

The way I "envisioned" the usage of this feature is that you would get the transaction name from https://sentry.io/performance/ and add it to ignore_transactions.

As @stayallive mentioned, we do not enforce any specific format in our base PHP SDK, for the Laravel SDK we decided to drop the HTTP_METHOD prefix in the latest major version.

@stevenwoodson
Copy link
Author

@stayallive Yeah I had a screenshot of the two within my Sentry logs from back when I was trying to figure out how to remove them initially, so I knew exactly how they were being logged. Great idea to check that though!

As both of you had mentioned, I think removing the HTTP methods was the missing piece. I've removed the HTTP methods from my code ('ignore_transactions' => ['/buddy', '/heartbeat'] as @stayallive suggested) and after about an hour it does appear to be working as I'm not seeing it logged anymore.

I was going by the example in the release at https://github.com/getsentry/sentry-php/releases/tag/3.17.0, so it may be a good idea to remove the HTTP method from that example (and any further documentation) too?

Going to close this now, thanks for the extra fast reply and again for doing all this in the first place. Honored to have been the impetus for this addition! I'll get my blog post on the subject updated as this is certainly easier to manage. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants