-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[extension/healthcheckv2] Ability to access the status.Aggregator
from another extension
#34692
Comments
status.Aggregator
from another extensionstatus.Aggregator
from another extension
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I would be interested in working on this once an agreement is made on the design and if this is something that is wanted. |
cc @mwear |
Thanks for the detailed writeup @blakerouse. I don't have any strong objections to exposing the status aggregator to other extensions, but I will also mention another use case that I believe we eventually want to address, and an additional alternative to consider. I believe it would be useful for the OpAMP extension to use the status aggregator for the component status message. I haven't looked into the feasibility of this just yet, but it's been on my radar. If we extracted the status aggregator into |
After thinking about this a little more, I do think that exposing an in-process healthcheck API, from the healthcheckv2extension makes sense. I'd be more inclined to expose an API interface that includes the |
@mwear I am open to either. I am leaning more towards your original comment of just placing the status aggregator in the If going down the path of just exposing the methods under the Really the status aggregator doesn't need to be exposed in If your open to it I could do a PR to just expose the status aggregator under the |
I think it would be preferable to move the aggregator to pkg rather than exporting it from the extension. Ideally we will keep the public API of the extension as small as possible. I think having the aggregator in pkg should work for the OpAMP extension, and it sounds like it'd work for your use case as well. |
@mwear Thanks for the feedback. I will work on a PR to move it. |
Component(s)
extension/healthcheckv2
Is your feature request related to a problem? Please describe.
Currently the
opampextension
uses the original healthcheckextension and it determines if the collector is healthy by performing an HTTP request to its own process to determine if the collector is health. https://github.com/open-telemetry/opamp-go/blob/ed38d5f4bf930b57e04581919fbfb676aaa5a5af/internal/examples/supervisor/supervisor/supervisor.go#L435This is not great from the standpoint of requiring the healthcheck endpoint to be exposed on the host just to get health of the current process that the
opampextension
is also running in. If you don't want any endpoint exposed thenopampextension
is unable to determine health. It is also very inefficient to determine status as it requires the a HTTP connection from its own process to the same process to just get status information. Another possible issue is IP table rules that prevent localhost port access prevent the ability to get this information (rare, but I have see it happen). It would be much better if this could be done in process.It would be better if an extension could access the
healthcheckv2extension
internalstatus.Aggregator
so it can determine the status of the collector without having to perform HTTP/GRPC requests and expose an endpoint on the host.Describe the solution you'd like
It would be great if something like the following could be done from inside another extension to access the aggregator:
Another option would just to expose
AggregateStatus
andSubscribe
directly on thehealthcheckv2extension
through an interface without exposing the entire function interface to the caller becauseRecordStatus
should not really be called externally.Describe alternatives you've considered
Another alternative would allow an extension to register a sub-component inside of the
healthcheckv2extension
. This would allow another extension to expose a different way of getting the health check information versus only HTTP and/or GRPC. This could be done using the same approach:Downside of this approach is if the extension sets the
healthcheckv2extension
as aDependent()
then it will already be started (I believe) beforeStart(...)
is called on the extension. TheAddComponent
function would then need to start the sub-component at the time of registering. I also believe this will require exposing more internal interfaces and types to extensions that might not be desired.Additional context
No response
The text was updated successfully, but these errors were encountered: