Component(s)
receiver/sqlserver
Describe the issue you're reporting
In the sqlserverreceiver, for the query that fetches query metrics and plans, the parameters are passed from the receiver. In this code, TopQueryCollection.topQueryCount was used instead of TopQueryCollection.MaxQuerySampleCount, causing a significantly smaller number of queries to be sampled for calculating the actual top N results.
This needs to be fixed for more accurate metrics collection.
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.