Skip to content

Conversation

@pellared
Copy link
Member

@pellared pellared commented Apr 22, 2025

Towards (for OTLP logs exporter):

Per https://github.com/open-telemetry/opentelemetry-go/pull/6362/files#r1978191352

Together with @dmathieu, we discussed whether we should accept http.Client or http.RoundTripper and we felt that http.RoundTripper is a better option. I think the reason is that mainly because it does not conflict with Timeout option and env vars. Maybe there were other reasons as well which I do not remember?

On the other hand, users may want to use other fields of http.Client such as CheckRedirect (and others that may be added in future). It would also allow easier interoperability e.g. with https://pkg.go.dev/golang.org/x/oauth2/clientcredentials#Config.Client and also see #2632. It would be also similar to this: https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc#WithGRPCConn

I am learning towards accepting http.Client, but I would prefer first to hear what others think before I do anything.

EDIT: I created #6688 if someone wants to check the differences.

CC @kevingentile

@pellared pellared changed the title otlploghttp: Add WithTransport option [Proposal] otlploghttp: Add WithTransport option Apr 22, 2025
@pellared pellared marked this pull request as ready for review April 22, 2025 09:02
@pellared pellared requested review from MrAlias and XSAM as code owners April 22, 2025 09:02
@pellared
Copy link
Member Author

I created #6688 if someone wants to check the differences.

@pellared pellared closed this Apr 23, 2025
pellared added a commit that referenced this pull request May 7, 2025
Towards (for OTLP logs exporter):
- #4536
- #5129
- #2632


Per
https://github.com/open-telemetry/opentelemetry-go/pull/6362/files#r1978191352

Providing `WithHTTPClient` option allows easy interoperability e.g. with
https://pkg.go.dev/golang.org/x/oauth2/clientcredentials#Config.Client
and also see
#2632. The
options is also similar to:
https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc#WithGRPCConn

I favor this over
#6686

The option for OTLP span and metrics exporters will be added in separate
PRs.
@pellared pellared deleted the log-WithTransport branch May 20, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant