GithubHelp home page GithubHelp logo

Comments (7)

SergeyKanzhelev avatar SergeyKanzhelev commented on May 18, 2024

Questions:

  • How monitoring will behave if send will be sent again before the callback or result returned?
  • Is it a valid scenario to do multiple send for one open?
  • Will we detect long-poll ajax calls and adjust their processing so they do not make average ajax execution time enormously big?
  • Do we instrument abort method?
  • is Callbacks only stored in XHR object itself? If not - will it keep it from being garbage collected as it keeps delegates on it?
  • Will the ajaxRecord stay alive after trackAjax call? Will Callbacks unsubscribe of onreadystatechange after that?
  • Do we plan to stop and send in-flight ajax calls on page onbeforeunload callback?

As a side note I'd advice to set a lock when you call original Open and original Send so that "originl" callback wouldn't call you back and enter recursion in case when customer application has some logic that also does override of XHR and do not expect somebody in the middle to change callbacks.

from applicationinsights-js.

MaxShehovtsov avatar MaxShehovtsov commented on May 18, 2024

Thank you for the feedback:

  • 2nd should fail (and does so in chrome), however we shouldn't execute send handler 2nd time. I'm adding validations for this.
  • long ajax - I think they will be there, spoiling averages, and it's by design
  • We do instrument abort however we currently don't send any data about abortion status. So depending on timing when abort was called - if request succeeds it'll be treated as any other ajax call. It makes sense to send the custom property with abortion status though.
  • by callbacks i mean 2 different things 1) the xhr instance owns the onreadystatechange callback, it lives on xhr and dies with it. 2) there is an event listenerer for "readystatechange" event - this one lives on ajaxMonitor instance, however it gets unsubscribed once xhr is complete. Unless the number of xhr instances that are not completed (aborted or finished) grows we should be ok. Otherwise we'll not be major contributors to the memory growth.
  • ajaxRecord dies with xhr
  • onbeforeunload proved unusable for events sending, so all open ajaxes will be lost (similarly to other batched telemetry unless batch timeout and/or batch size is overriden)

from applicationinsights-js.

bengreenier avatar bengreenier commented on May 18, 2024

i noticed there's no milestone associated with this issue - any idea when this feature will be officially supported/fully documented?

from applicationinsights-js.

MaxShehovtsov avatar MaxShehovtsov commented on May 18, 2024

Hopefully within next couple weeks

from applicationinsights-js.

bengreenier avatar bengreenier commented on May 18, 2024

bump - any updates here?

from applicationinsights-js.

MaxShehovtsov avatar MaxShehovtsov commented on May 18, 2024

@bengreenier It's actually done - https://azure.microsoft.com/en-us/blog/ajax-collection-in-application-insights/
P.s. I thought I closed this issue - my bad it's left open, sorry.

from applicationinsights-js.

github-actions avatar github-actions commented on May 18, 2024

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.

from applicationinsights-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.