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

Support for JDK Http client? #13446

Open
marco-farinetti-evooq opened this issue Mar 4, 2025 · 2 comments
Open

Support for JDK Http client? #13446

marco-farinetti-evooq opened this issue Mar 4, 2025 · 2 comments

Comments

@marco-farinetti-evooq
Copy link

Hi all,
Support for using the jdk http client in the exporters rather than the okhttp one was introduced in open-telemetry/opentelemetry-java#5351.
As far as I see the agent doesn't support this feature nor it can be configured in an extension.
Are there plans to include it?
Thank you

@laurit
Copy link
Contributor

laurit commented Mar 4, 2025

As far as I see the agent doesn't support this feature nor it can be configured in an extension.

Could you elaborate what prevents you from configuring it from an extension?

Are there plans to include it?

I'm not aware of such plans

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Mar 4, 2025
@marco-farinetti-evooq
Copy link
Author

marco-farinetti-evooq commented Mar 4, 2025

Could you elaborate what prevents you from configuring it from an extension?

Maybe I'm doing something wrong, if you have hints it's appreciated. Here's what I tried:

added the dependency in the extension:

    implementation("io.opentelemetry:opentelemetry-exporter-sender-jdk")
//  exclude okhttp from the otlp exporter
    implementation("io.opentelemetry:opentelemetry-exporter-otlp") {
        exclude(group = "io.opentelemetry", module = "opentelemetry-exporter-sender-okhttp")
    }

From what I understand the HttpSenderProvider implementation to use is defined in META-INF/services/io.opentelemetry.exporter.internal.http.HttpSenderProvider (which for the jdk client contains io.opentelemetry.exporter.sender.jdk.internal.JdkHttpSenderProvider).

But if the java agent jar contains the okhttp implementation it always uses that one no matter what I define in the extension.

@github-actions github-actions bot removed the needs author feedback Waiting for additional feedback from the author label Mar 4, 2025
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

No branches or pull requests

2 participants