Closed mikecabana closed 1 year ago
Hi @mikecabana, yes 100% agree, this is one of the enhancements that we will be looking at creating next year (based on current planning). It may not be exactly as you have described, but the high level design is
We can't commit to a timeframe just yet as there are some other largish features ahead of this work and this has implications on minification / tree shaking efforts (i.e. it's going to add more code)
Hey @MSNev that's awesome to hear. Looking forward to using this enhancement when it's released!!
It's not really a show stopper for now on my end but would you have any suggestions or workarounds that can get me going in the meantime?
At this point no, the only suggestion I can immediately think of would be to create a lazy initialization layer. I assume your not using the snippet, in which case as part of that layer you would have to cache (save into an array -- the same way as the ai queue ) any calls you have and replay them one you initialize.
@MSNev Gotcha - I'll give it a shot thanks!
In case anyone comes across this thread, I think I came up with a decent workaround that's not to hard on the eyes ;). Improvements are welcome.
https://stackblitz.com/edit/angular-ivy-iujyla?devtoolsheight=33&file=src/app/app.module.ts
An update on progress, we originally intended to deliver this as part of the next release v2.8.0 but because of the size of the changes required the next release will only partial support this.
Simplistically, v2.8.0 is going to support completely unloading and re-initializing the SDK (not ideal but a start) and we are planning that the next major release (v3.0.0) will include full support to dynamically update the config on the fly.
Timeline wise apart from bug fixes to the 2.8.0 lineage 3.x will be the next release that we will start working on (initially in the beta branch).
One other planned change to 3.x is that we are currently intending to drop ES3 (IE8) support.
v2.8.0 is now released and published to NPM, because of the size of the change it isn't planned to be fully available on the CDN until April 25th, 2022
Please use v2.8.1 as v2.8.0 had a couple of issue, specifically it disabled automatic exception tracking.
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'd like to be able to update the configuration of application insights after it has already been initialized. I've wrapped the package in an Angular Library using
APP_INITIALIZER
so using ai is much more straight forward for my team. The only issue is that something like the Angular plugin requires to run an init step. Not really compatible with passing config usingforRoot({...})
Describe the solution you'd like I'd like to be able to do something like
Running the above code of course errors out with