newrelic / newrelic-dotnet-agent

The New Relic .NET language agent.
Apache License 2.0
97 stars 59 forks source link

Add the ability to disable ConfigurationManager API support #2821

Open nrcventura opened 1 week ago

nrcventura commented 1 week ago

Describe the story, please be clear on scope of the story.

There are a handful of settings that the agent supports that are retrieved using the ConfigurationManager APIs. Our usage of the ConfigurationManager during agent initialization can sometimes lead to deadlock scenarios when the application being monitored has configured the ConfigurationManager to integrate with APIs that the agent also instruments. In some scenarios it can be difficult to get a memory dump to help with identifying which method(s) are triggering the problem. To make it easier to troubleshoot these types of problems, the agent should provide a configuration option (newrelic.config and environment variable) so that the agent's usage of the ConfigurationManager APIs will be skipped.

In order to use this option, customers will need to ensure that any New Relic agent settings they were defining in web.config, app.config, or appsettings.json are migrated into either an app-local newrelic.config file or application specific environment variable.

Acceptance Criteria

  1. The default value for this setting results in the agent using the ConfigurationManager APIs (the current agent behavior)
  2. Disabling this setting results in the agent not using the ConfigurationManager APIs.

Dependencies

None

Describe Design Consideration/Limitations

This is meant to provide a simpler workaround for scenarios where it is more difficult to determine what to add to the current delayed initialization environment variables.

Additional context

This is meant to assist with situations like #2809.

Estimates

Initial t-shirt size: Small

workato-integration[bot] commented 1 week ago

https://new-relic.atlassian.net/browse/NR-323920