open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.49k stars 1.48k forks source link

[receiver/scraperhelper] Confirm intended side effects of scraper.ID deprecation. #11691

Open TylerHelmuth opened 4 days ago

TylerHelmuth commented 4 days ago

Description

In https://github.com/open-telemetry/opentelemetry-collector/pull/11659 Scraper.ID was deprecated in favor of AddScraperWithType. During the v0.114.0 release I found that this was an incompatible switch for the hostmetric receiver's factory tests.

The hostmetrics receiver is testing factory.CreateMetricsScraper which returns a scraperhelper.Scraper and is not calling scraperhelper.NewScraperControllerReceiver so scraperhelper.AddScraperWithType isn't an option. To move forward with the release I removed the test's use ofScraper.ID`.

Was this an intended outcome of the change? If so this issue can be closed.

Related: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36395#discussion_r1846907639