-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: Allows instrumentation to be disabled from a newrelic.config file. #2250
Conversation
…pear in any order. (#2249)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2250 +/- ##
==========================================
+ Coverage 81.07% 81.09% +0.01%
==========================================
Files 396 396
Lines 24713 24739 +26
Branches 2997 2999 +2
==========================================
+ Hits 20036 20062 +26
+ Misses 3890 3889 -1
- Partials 787 788 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
BEGIN_COMMIT_OVERRIDE
feat: Allows instrumentation to be disabled from a newrelic.config file. Refer to our instrumentation configuration documentation for details. (#2250)
END_COMMIT_OVERRIDE
Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.
Description
Allows customers to control which assemblies and optionally classes should not be instrumented by specifying instrumentation ignore rules within a newrelic.config file.
Previous techniques required customers to directly remove or modify the installed instrumentation xml files. This new method should make it easier for these customers to upgrade the agent and keep certain instrumentations disables. It also enables the ability to have instrumentations disabled on a per application basis when a newrelic.config file is deployed with each application.
If you do not want a particular assembly instrumented you can add the following snippet to the instrumentation element in the newrelic.config file.
The
ignore
rule instructs the profiler to not instrument any methods defined in the specified assembly. Methods defined in other assemblies will still be instrumented.The
ignore
rule allows you to optionally define a class name. In the following example, only methods defined inMyNamespace.MyClass
in the assemblyMyAssembly
will be ignored. Other methods in other classes both inside that assembly and within other assemblies will not be ignored by the profiler.More than one ignore rule can be specified. The following example disables both the Confluent Kafka and StackExchange Redis instrumentations.
CAVEAT - Custom instrumentation added by using the
Transaction
orTrace
attributes are not affected by this new configuration option. It only affects xml based custom instrumentation or the default instrumentation packaged with the .net agent.Author Checklist
Reviewer Checklist
chore(main): release 10.21.0 #2213