-
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
[component] Review component.Host.GetFactory
#9511
Comments
One example where we do the optional interface thingie opentelemetry-collector/extension/zpagesextension/zpagesextension.go Lines 58 to 66 in 91f13c3
|
Removing it from the On the other hand, the functionality is interesting and simple for any Since we only have 1 use case that utilizes this feature, I am in favor of the optional interface approach, but would be ok if we choose to keep it on the interface. |
I think we could change the behavior so that the |
Here is the draft PR with a design experiment: #10679 I changed the design a bit so you can only get access to receiver factories, hopefully that's fine given the only use case we have is about creating receivers. |
…nterface (#34234) **Description:** Updates receivercreator in preparation for `component.Host.GetFactory` to be removed. **Link to tracking Issue:** <Issue number if applicable> Related to open-telemetry/opentelemetry-collector#9511 **Testing:** <Describe what testing was performed and which tests were added.> Unit tests. I cant add a unit test yet that fails the interface check since being compliant with `component.Host` still requires the `GetFactory` method.
#### Description This PR deprecates the `component.Host.GetFactory` interface. This has the benefit of keeping the `component.Host` interface as simple as possible. Components that were relying on this method can instead check if the underlying `component.Host` implementation supports the interface. An example of this pattern can be found here: https://github.com/open-telemetry/opentelemetry-collector/blob/91f13c309d00eef5b997a2e810effb2a4ccd95d4/extension/zpagesextension/zpagesextension.go#L58-L66 #### Link to tracking issue Related to #9511
component.Host.GetFactory
is used by a single component: the receivercreator. While it may not be possible it would be great to consider if we can remove this or maybe make it optional (by having an optional interface that the service can implement). This would simplify theHost
interfaceThe text was updated successfully, but these errors were encountered: