Skip to content

Remove deprecated methods from HTTP client and server library instrumentation modules#15892

Merged
trask merged 3 commits intomainfrom
copilot/remove-deprecated-methods-http-library
Jan 19, 2026
Merged

Remove deprecated methods from HTTP client and server library instrumentation modules#15892
trask merged 3 commits intomainfrom
copilot/remove-deprecated-methods-http-library

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 17, 2026

Removes all deprecated methods from HTTP client and server library instrumentation modules as part of API cleanup.

Changes

HTTP Client Libraries

  • java-http-client: Removed newHttpClient() (replaced by wrap())
  • apache-httpclient 4.3/5.2: Removed newHttpClient() and newHttpClientBuilder() (replaced by createHttpClient() and createHttpClientBuilder())
  • jetty-httpclient 9.2/12.0: Removed getHttpClient() getter and deprecated builder setters setHttpClientTransport() and setSslContextFactory()
  • okhttp-3.0: Removed newCallFactory() (replaced by createCallFactory())

HTTP Server Libraries

  • java-http-server: Removed newFilter() (replaced by createFilter())

Code Cleanup

  • Removed unused httpClient fields and builder parameters in JettyClientTelemetry classes
  • Deleted deprecated test classes: JettyHttpClient12LibraryDeprecatedApiTest and JettyHttpClient9LibraryDeprecatedApiTest
  • Cleaned up unused imports

Migration Example

// Before (deprecated)
JavaHttpClientTelemetry telemetry = JavaHttpClientTelemetry.create(openTelemetry);
HttpClient client = telemetry.newHttpClient(HttpClient.newHttpClient());

// After
JavaHttpClientTelemetry telemetry = JavaHttpClientTelemetry.create(openTelemetry);
HttpClient client = telemetry.wrap(HttpClient.newHttpClient());

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • develocity.opentelemetry.io
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • scans-in.gradle.com
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

remove all deprecated methods from HTTP client and server library instrumentation modules


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Remove all deprecated methods from HTTP client and server library Remove deprecated methods from HTTP client and server library instrumentation modules Jan 17, 2026
Copilot AI requested a review from trask January 17, 2026 03:11
@trask trask marked this pull request as ready for review January 17, 2026 03:51
@trask trask requested a review from a team as a code owner January 17, 2026 03:51
@trask trask merged commit cafd23a into main Jan 19, 2026
86 checks passed
@trask trask deleted the copilot/remove-deprecated-methods-http-library branch January 19, 2026 17:19
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Breaking Change Documentation Required

This PR has been labeled as a breaking change. Please ensure you provide the following information:

Migration Notes Required

Please add detailed migration notes to help users understand:

  • What is changing and why
  • How to update their code/configuration
  • Any alternative approaches if applicable
  • Code examples showing before/after usage

Checklist

  • Migration notes added to the PR description
  • Breaking change is documented in the "Unreleased" section of the Changelog, preferably as part of this PR.
  • Consider if this change requires a major version bump

Your migration notes will be included in the release notes to help users upgrade smoothly. The more detailed and helpful they are, the better the user experience will be.


This comment was automatically generated because the breaking change label was applied to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants