Skip to content

otelhttp: Deprecate DefaultClient#8140

Merged
dmathieu merged 5 commits into
open-telemetry:mainfrom
KonstantinosTsitoumis:main
Nov 14, 2025
Merged

otelhttp: Deprecate DefaultClient#8140
dmathieu merged 5 commits into
open-telemetry:mainfrom
KonstantinosTsitoumis:main

Conversation

@KonstantinosTsitoumis
Copy link
Copy Markdown
Contributor

makes defaultClient private and creates a function that initialises it only once.

created for issue: #8131

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Nov 6, 2025

CLA Signed

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.8%. Comparing base (66175c1) to head (bd886d0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #8140   +/-   ##
=====================================
  Coverage   81.8%   81.8%           
=====================================
  Files        194     194           
  Lines      13377   13377           
=====================================
  Hits       10951   10951           
  Misses      2029    2029           
  Partials     397     397           
Files with missing lines Coverage Δ
instrumentation/net/http/otelhttp/client.go 66.6% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KonstantinosTsitoumis KonstantinosTsitoumis force-pushed the main branch 4 times, most recently from 1589ed8 to 0c5a22d Compare November 6, 2025 23:56
@flc1125
Copy link
Copy Markdown
Member

flc1125 commented Nov 7, 2025

As mentioned in: #8131 (comment), we need to first mark it as deprecated before proceeding with the replacement. We need to give users a transition period.

I suggest that you discuss and confirm the specific details of the deprecation and replacement plan on the issue page so that we can proceed with the follow-up work.

PS: This issue is expected to be split into multiple phases for implementation.

Copy link
Copy Markdown
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #8131 (comment):

I propose deprecating and later removing

Also #8140 (comment)

@KonstantinosTsitoumis KonstantinosTsitoumis changed the title otelhttp: make DefaultClient immutable otelhttp: Deprecate DefaultClient Nov 7, 2025
Copy link
Copy Markdown
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at other "deprecation" PRs for reference such as #8117

Comment thread instrumentation/net/http/otelhttp/client.go Outdated
Comment thread instrumentation/net/http/otelhttp/client.go Outdated
Comment thread instrumentation/net/http/otelhttp/client.go Outdated
Copy link
Copy Markdown
Member

@flc1125 flc1125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked: Release plan

Comment thread instrumentation/net/http/otelhttp/client.go Outdated
Comment thread CHANGELOG.md Outdated
Co-authored-by: Robert Pająk <pellared@hotmail.com>
@dmathieu dmathieu merged commit 6be0ad1 into open-telemetry:main Nov 14, 2025
26 checks passed
@MrAlias
Copy link
Copy Markdown
Contributor

MrAlias commented Nov 20, 2025

There is not now way to set the client used by Get, Post, PostForm, and Head without using this deprecated value. An alternative should have been explored or those methods also handled in this process.

@MrAlias MrAlias mentioned this pull request Dec 8, 2025
@MrAlias MrAlias added this to the v1.39.0 milestone Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants