newrelic-dotnet-agent
newrelic-dotnet-agent copied to clipboard
.NET Agent requests more explain plans than needed
Description When explain plans are enabled, the .NET agent currently requests up to 20 plans per transaction for any Datastore segments over the configured explain plan duration threshold. These explain plans are requested before the agent knows if the plans will even be sent up to NR1 depending on collection limits for Transactions and SqlTraces. Depending on how the threshold is configured, this can result in SIGNIFICANTLY more explain plans being requested than is desirable.
Additionally, the existing documentation makes it sound like, by default, only 20 explain plans will be captured per harvest cycle, but this is actually referring to how many will be captured per transaction. (fixed in docs)
Additionally, the .NET Agent only sends up 10 SqlTraces per harvest cycle. This is hardcoded, and not currently configurable.
Expected Behavior The .NET agent only requests explain plans for datastore segments that will be sent up to NR1, and the global 'per harvest cycle' configuration for explain plans is respected across all transactions within a harvest cycle.
Steps to Reproduce
- Enable SQL explain plans
- Set the explain plan threshold to 0 milliseconds (capture all the explain plans!)
- Run a .NET application that makes MSSQL calls and monitor the number of explain plans requested in comparison to the 10 that are sent up.
For Maintainers Only or Hero Triaging this bug Suggested Priority (P1,P2,P3,P4,P5): P4 Suggested T-Shirt size (S, M, L, XL, Unknown): L