Skip to content
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

[service] Define strategy for 'privileged' components #10181

Open
mx-psi opened this issue May 20, 2024 · 2 comments
Open

[service] Define strategy for 'privileged' components #10181

mx-psi opened this issue May 20, 2024 · 2 comments

Comments

@mx-psi
Copy link
Member

mx-psi commented May 20, 2024

For some components we cast the component.Host passed by the service to an interface that implements

We have also used this strategy the other way around in the ballast extension:

for _, ext := range host.GetExtensions() {
if bExt, ok := ext.(interface{ GetBallastSize() uint64 }); ok {
return bExt.GetBallastSize()
}
}

In the context of service 1.0, I want to answer the following questions:

  1. Is this an acceptable strategy? Is it our preferred way of doing things in some cases?
  2. If the answer to (1) is yes, what stability guarantees do we provide for this? (I'd argue the standard stability guarantee for this is 'none', but maybe we should make this crystal clear in VERSIONING.md)
  3. If the answer to (1) is yes, then should we address [component] Review component.Host.GetFactory #9511?
@yurishkuro
Copy link
Member

@mx-psi Are all those even valid use cases to have something in the Host?

E.g. the ballast extension example does not depend on Host implementing anything, it just looks for a specific extension + interface, which is a pattern that I think is more useful (e.g. Jaeger components often interact this way by requiring a specific extension to exist and then using that extension's specific APIs).

The zpages example looks like a hack that was not well-designed. It seems that it's adding an endpoint handler to some central server (admin server?). If so, it seems it could also be solved with an extension dependency, e.g. we could have an admin server extension that other components could add endpoints too (e.g. healthcheck extension could add HC endpoint).

@mx-psi
Copy link
Member Author

mx-psi commented May 20, 2024

It seems that it's adding an endpoint handler to some central server (admin server?). If so, it seems it could also be solved with an extension dependency, e.g. we could have an admin server extension that other components could add endpoints too (e.g. healthcheck extension could add HC endpoint).

The way we would do this right now is to add the method to component.Host.

I guess the question here is: is it required for the service to implement this zpages support? Or do we consider it optional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants