-
Notifications
You must be signed in to change notification settings - Fork 237
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
maxAjaxCallsPerView doesn't account for filtering by TelemetryInitializer #1887
Comments
That is not going to work as the What I think you are trying to do is just stop the request from being tracked, which there is a config for that is evaluated here the config is called |
And if you are controlling the requests, there is another more "hacky" way, but id prefer you use the above if that works for you. |
That was my strong suspicion, but I'm not familiar enough with the code base to be able to verify that without a learning curve.
Good to know. Looks useful, but doesn't quite fit my use case. The requests I'm wanting to exclude are being made by a JS component that's very chatty (an interactive map). I don't want to log its successful requests, but I do want to log failed requests, so I need a more nuanced filter than
As above, nope. And it's hard to imagine any other man-in-the-middle or monkey-patching options would be superior to the alternative I first posted: set As a consolation, maybe this should just be a request for documentation update on https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-monitor/app/javascript.md, to point out that |
Ok, understand. |
Yes, that would work. At first glance, it looks like extending
No sweat. |
Ok, I had to add some code around the same area so I went ahead and added support for this at the same time. |
…izer #1887 - Highlight the beta development
…izer #1887 - Highlight the beta development
Ok, I managed to sneak this into the next release (should start later this week) as it was around the same location as some other required changes. I've added a All going well there should be an automated nightly deployment tonight with this change included that you should be able to test before the final release. |
…izer #1887 - Highlight the beta development
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
I'm using a telemetry initializer to filter out a large volume of AJAX remote dependency calls that fit a particular criteria. Depending on user activity, there may be thousands of dependency calls that do not get logged.
The problem though, is that these filtered / excluded events still count towards the count of tracked AJAX attempts, which is limited per maxAjaxCallsPerView configuration parameter.
So, say there are 1,000 AJAX requests on the page. 980 of them get filtered by my telemetry initializer. The remaining 20 may not all get logged, because the 980 that were filtered out, all counted towards the default limit of 500, then I get error:
"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter."
Describe the solution you'd like
AJAX remote dependancy calls that are filtered by a telemetry initializer should not count towards the maxAjaxCallsPerView.
Describe alternatives you've considered
I can set maxAjaxCallsPerView to -1, so I do get all AJAX dependencies logged. I can then use the telemetry initializer to implement my own "max ajax calls per view" logic, so there's no loss of functionality. It's just:
a) A bit of extra work, and;
b) An unexpected outcome - it's strange to have, say, only 20 AJAX dependencies logged, while simultaneously getting the error "Maximum ajax per page view limit reached".
Additional context
Refer: extensions\applicationinsights-dependencies-js\src\ajax.ts
_trackAjaxAttempts
variable is checked, and incremented in this function.The text was updated successfully, but these errors were encountered: