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
1ms delay before fetch causing issues with New Relic SPA logger #345
Comments
#220 linking this issue for more exposure |
I was able to reproduce this by using native fetch and adding the same
At this point, it might be an issues i need to take it up to New Relic.. Super strange behavior. |
I further confirmed that it indeed may be more of an issue with New Relic. They seem to not log AJAX requests when there are other promises happening "around them". I tried adding a promise right before fetching using libraries that does work with New Relic logging, and immediately, it stopped working.
none of these were logging to New Relic. but.. the following works (chaining only axios)
and yet the following doesn't:
|
Great debugging, thanks for the details. If you have an idea about how we could remove the delay, we would gladly consider it. But at the moment, I'm not aware of any way to do that without making major changes to the API (which we can also discuss but I think it's unlikely to happen). Given the above and the fact that this is reproducible without Ky, I'm going to close this issue for now. Will reopen if anything actionable comes up. Depending on New Relic's response, maybe we could provide a way to opt-out of the delay. |
…m that NewRelic fails to log requests
Hi, Much thanks to the great work from @smblee. We've encountered exactly the same problem with NewRelic. I found that we can fix the problem by replacing the I will open a PR for this. Hopefully we can reopen this ticket and have further discussion. Thanks. |
@smblee you're just using the newrelic browser agent SPA right? I saw many open issues about the NR agent not supporting |
@darrinmn9 Their documentation honestly isn't great especially around SPA/Pro browser agent. Some of their pages mention they don't support That being said, we will try to upgrade to new ky whenever we can get around to it. If you do also and encounter unexpected behaviors please share! |
I found a finicky bug where the implementation detail of ky waiting 1ms before fetch (#118) is actually not allowing New Relic Pro+SPA to log AJAX requests.
I am not sure of the full detail of why this may be happening - but this is how i have verified it's being caused by 1ms setTimeout.
fetch
andwretch
library instead ofky
. New Relic was able to pick up all AJAX requests for both scenarios.axios
that relies on XHR requests. New Relic was also able to pick this up.ky
but manually commented out theawait delay(1);
from ky insidenode_modules
, and it started working (granted, the.json
function fails, but the request was getting picked up)Do you guys have any idea why this may be happening?
If so, do you have suggestions on how to get around this issue?
The text was updated successfully, but these errors were encountered: