-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(transport/all): Add ability to specify []otelhttp.Opts for transport when create new HTTP client #3130
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
base: main
Are you sure you want to change the base?
feat(transport/all): Add ability to specify []otelhttp.Opts for transport when create new HTTP client #3130
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
637aa91
to
0ba3fdd
Compare
@surik Can you please open a feature request issue in this repo explaining your need for otelhttp.Option in the HTTP Client? Thank you. |
048ca08
to
334fb10
Compare
334fb10
to
899af84
Compare
Kokoro CI failed with staticcheck:
|
a1ce8e4
to
2c7e275
Compare
@@ -306,7 +306,7 @@ func addOpenTelemetryTransport(trans http.RoundTripper, settings *internal.DialS | |||
if settings.TelemetryDisabled { | |||
return trans | |||
} | |||
return otelhttp.NewTransport(trans) | |||
return otelhttp.NewTransport(trans, settings.OpenTelemetryOptsHTTP...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For both this and the gRPC package this change is fine to make, but it won't actually enable the feature for most users -- that is because these packages, by default, delegate to our new auth library which has its own transport packages: https://pkg.go.dev/cloud.google.com/go/auth
At the very least I think we should add some TODOs and keep the issue open until this is plumbed all the way through to the new auth packages. See the newClientNewAuth
function in this file as an example of how we delegate calls to this new library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @codyoss! I added a todo.
…sport when create new HTTP client
…rt otelhttp and otelgrpc
5c1a701
to
7803b46
Compare
See #3138