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

Implement opamp extension configuration reading and validation #16619

Closed
Tracked by #16462
tigrannajaryan opened this issue Dec 5, 2022 · 9 comments
Closed
Tracked by #16462

Implement opamp extension configuration reading and validation #16619

tigrannajaryan opened this issue Dec 5, 2022 · 9 comments
Labels
never stale Issues marked with this label will be never staled and automatically removed

Comments

@tigrannajaryan
Copy link
Member

No description provided.

@tigrannajaryan tigrannajaryan changed the title Implement extension configuration reading and validation Implement opamp extension configuration reading and validation Dec 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Jun 12, 2023
@tigrannajaryan tigrannajaryan added never stale Issues marked with this label will be never staled and automatically removed and removed Stale labels Jun 12, 2023
@srikanthccv
Copy link
Member

srikanthccv commented Jun 28, 2023

@tigrannajaryan, since the open-telemetry/opentelemetry-collector#6599 is completed, I think we can use the service.instance.id as a replacement for instance_uid. So the config for opamp extension would look something like.

type Config struct {
    Endpoint string `mapstructure:"endpoint"`
    confighttp.HTTPClientSettings `mapstructure:",squash"`
}

@tigrannajaryan
Copy link
Member Author

HTTPClientSettings typically assumes you use ToClient() to get an http.Client to work with. This won't work with OpAMP which implements its own client connection and there is no way to pass an http.Client to use: https://pkg.go.dev/github.com/open-telemetry/[email protected]/client

If you can't use ToClient() you have to re-implement everything HTTPClientSettings does, which I am not sure is a good idea.

Possible options are:

  • Change NewHTTP to accept http.Client to use. That would limit OpAMP extension to OpAMP/HTTP transport only, since WebSocket doesn't use http.Client at all. This is very undesirable, I want OpAMP extension to support OpAMP/WebSocket transport and use that for local interaction between Supervisor and Collector.
  • Don't use HTTPClientSettings directly. Instead borrow just the fields that we can support with existing OpAMP clients (Endpoint, Headers, TLSConfig, Compression).

@srikanthccv
Copy link
Member

I was thinking we could use the HTTPClientSettings and decide whether to use the ToClient based on the provided scheme. Use the Dialer if the URL scheme is ws/wss. I think borrowing the relevant fields is a good idea. Can we add WithClient/WithDailer opamp client that allows users to provide custom http.Client/websocket.Dialer? What do you think?

@tigrannajaryan
Copy link
Member Author

Can we add WithClient/WithDailer opamp client that allows users to provide custom http.Client/websocket.Dialer? What do you think?

I think it should be possible.

@srikanthccv
Copy link
Member

I wonder if there was a reason behind passing settings at the time of Start instead of creating a new client with ClientSettings. Functionally I don't see much of a difference; having it already set up with given settings before the Start call makes it easier to customize sender/dailer. Either way, I can pick some of these issues and start working, but I guess there should be an extension skeleton first.

@evan-bradley
Copy link
Contributor

I think the basic requirements of this issue have been met, providing custom transport clients to the OpAMP client library will need to be tackled separately in opamp-go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
never stale Issues marked with this label will be never staled and automatically removed
Projects
None yet
Development

No branches or pull requests

4 participants