Description
Component(s)
receiver/sqlserver
Describe the issue you're reporting
As discussed, it looks like some metrics are double reported on Windows when direct connection is configured. The metrics being double reported are any metrics that don't have any extended documentation warning, meaning they're being scraped both from the direct connection and Windows performance counters.
I wasn't able to test this, but the logic looks like it's the case. The WPC scraper is setup alongside the direct connection queries, meaning both will be emitting metrics.
I believe the solution here should be to only use direct connection functionality if it's configured, skipping WPC in that case. The downside to this solution is there are some metrics that are only available from WPC currently, so the user would need to configure two separate receivers, one scraping WPC the other direct connection.