Possibility to wrap http.Client.Transport with custom RoundTripper

Hi, I have a slim Golang API that communicates with LXD clusters using the client InstanceServer in github.com/lxd/client.

At some point I call ConnextLXDWithContext, which takes ConnectionArgs as an argument, which I’m using to pass in a custom http client via ConnectionArgs.HTTPClient.

In my custom http client I have an implementation of http RoundTripper, which wraps the original http Transport with some distributed tracing logic.
The problem I’m facing is that my RoundTripper is being overwritten down the line here.

Would it be possible to extend the ConnectionArgsto take an extra field that wraps the TLS transport set by you?

I have a pull request with a suggestion.
Thanks

1 Like

PR https://github.com/lxc/lxd/pull/11318 has been merged.

Thanks!

1 Like

Awesome, thank you!

1 Like