Dynamically updating config (for extensions in my case)
See original GitHub issueIs 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 using forRoot({...})
Describe the solution you’d like I’d like to be able to do something like
addExtension(extension: ITelemetryPlugin, config?: { [extKey: string]: { [configKey: string]: any } }): void {
const extensions = [...this.config.extensions, extension];
this.config = { ...this.config, extensions };
let extensionConfig = this.config.extensionConfig;
if (config) {
extensionConfig = { ...extensionConfig, config };
}
this.appInsights = new ApplicationInsights({
config: this.config
});
this.appInsights.reLoadAppInsights(); // <--- new function to update config
}
Running the above code of course errors out with
ERROR Error: Core should not be initialized more than once
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Use dynamic configuration using push refresh in a .NET Core ...
In this tutorial, you learn how to dynamically update the configuration data for .NET Core apps using push refresh.
Read more >microsoft/refreshing-config: Configuration library that ... - GitHub
Configuration library that can dynamically refresh configuration values. Usage. Construct your configuration store; Instantiate an instance of RefreshingConfig ...
Read more >How to enable Dynamic Categories Extension in Magento 2?
1. Enable the extension in order to be able to create dynamic categories. 2. Enter the Product Key which you can find in...
Read more >How to create dynamic configuration files using Ansible ...
Ansible templates extend your ability to configure applications quickly and easily. This example uses a template to configure Vim.
Read more >Extension configuration — envoy 1.25.0-dev-a95421 ...
Extension configuration can be supplied dynamically from an xDS management server using ExtensionConfiguration discovery service. The name field in the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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)
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.