-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Refine scraperhelper.NewScraper to take component.Type directly #11082
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11082 +/- ##
==========================================
- Coverage 92.21% 92.20% -0.01%
==========================================
Files 414 414
Lines 19728 19730 +2
==========================================
Hits 18193 18193
- Misses 1165 1167 +2
Partials 370 370 ☔ View full report in Codecov by Sentry. |
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.
Thanks!
@mrasu Can you open a PR on https://github.com/open-telemetry/opentelemetry-collector-contrib to make all components use the new API? |
@mx-psi ok, I will |
…-telemetry#11082) #### Description Create new function to enable to pass `component.Type` to `scraperhelper.NewScraper` Because many contrib scrapers name the scraper with the same name as the component itself, create a function to take `component.Type`. For example, https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/0e2bea5ac2763421e1a3943093f67184e109265f/receiver/activedirectorydsreceiver/factory_windows.go#L35 passes `metadata.Type.String()` as a name of scraper. With this change, you can pass `metadata.Type` instead <!-- Issue number if applicable --> #### Link to tracking issue Fixes open-telemetry#9473
Thanks to @djaglowski, optenetelemetry-collector-contrib use the new function now 😺 |
* Updated OpenTelemetry Collector modules for beta modules to 0.109.0 (core and contrib) and updated stable modules to 1.15.0 * Fixed linting violations caused by the deprication of scraperhelper.NewScraper open-telemetry/opentelemetry-collector#11082 Additionally added modules as `providers` in the ocb build configuration file. This resolved transative dependency issues when building the collector and issues reading config files. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Joshua Burns <[email protected]>
Description
Create new function to enable to pass
component.Type
toscraperhelper.NewScraper
Because many contrib scrapers name the scraper with the same name as the component itself, create a function to take
component.Type
.For example, https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/0e2bea5ac2763421e1a3943093f67184e109265f/receiver/activedirectorydsreceiver/factory_windows.go#L35 passes
metadata.Type.String()
as a name of scraper. With this change, you can passmetadata.Type
insteadLink to tracking issue
Fixes #9473