Skip to content

Conversation

@stevejgordon
Copy link
Contributor

Fixes #3588

Changes

Introduces a new HttpClientFactory setting in the OpAmpClientSettings class to allow customization of HttpClient instances for OpAMP HTTP transport. Updates PlainHttpTransport to utilize this factory, removing the HttpClientHandler and modifies OpAmpClient to pass settings to PlainHttpTransport.

This mostly copies the approach used for the OtlpExporterOptions in the main SDK.

  • Adds a test to verify the use of the configured HttpClientFactory, including custom headers.
  • Updates OpAmpFakeHttpServer to capture HTTP request headers and provide a method to retrieve them for testing.

Update CHANGELOG.md and PublicAPI.Unshipped.txt to document the new setting.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Introduce a new `HttpClientFactory` setting in the `OpAmpClientSettings` class to allow customization of `HttpClient` instances for OpAMP HTTP transport. Update `PlainHttpTransport` to utilize this factory, removing the `HttpClientHandler`. Modify `OpAmpClient` to pass settings to `PlainHttpTransport`.

Add a test to verify the use of the configured `HttpClientFactory`, including custom headers. Update `OpAmpFakeHttpServer` to capture HTTP request headers and provide a method to retrieve them for testing.

Update `CHANGELOG.md` and `PublicAPI.Unshipped.txt` to document the new setting.
@stevejgordon stevejgordon requested a review from a team as a code owner December 8, 2025 09:03
@github-actions github-actions bot requested a review from RassK December 8, 2025 09:03
@github-actions github-actions bot added the comp:opamp.client Things related to OpenTelemetry.OpAmp.Client label Dec 8, 2025
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.24%. Comparing base (48d18f6) to head (4503189).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/OpenTelemetry.OpAmp.Client/OpAmpClient.cs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3589      +/-   ##
==========================================
+ Coverage   71.22%   71.24%   +0.02%     
==========================================
  Files         442      442              
  Lines       17516    17515       -1     
==========================================
+ Hits        12475    12479       +4     
+ Misses       5041     5036       -5     
Flag Coverage Δ
unittests-OpAmp.Client 72.24% <90.00%> (+0.69%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ient/Internal/Transport/Http/PlainHttpTransport.cs 92.00% <100.00%> (+4.90%) ⬆️
...metry.OpAmp.Client/Settings/OpAmpClientSettings.cs 72.22% <100.00%> (+33.76%) ⬆️
src/OpenTelemetry.OpAmp.Client/OpAmpClient.cs 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Kielek
Copy link
Member

Kielek commented Dec 9, 2025

In the issues description you have mentioned mutual TLS. Please consider this SDK PR open-telemetry/opentelemetry-dotnet#6343 in this context.

@Kielek
Copy link
Member

Kielek commented Dec 9, 2025

@RassK taken longer break. He will be available next year. Is it fine to wait for him with this PR?

@stevejgordon
Copy link
Contributor Author

@Kielek I have been chatting with @RassK on some blockers for us to start using the OpAmp client. This and one other (PR incoming today/tomorrow) are the main blockers I'm aware of immediately. Ideally we'd get these in sooner and potentially another release done so I can take that work further. Is that a possibility? Otherwise I'm blocked from working with this new feature. I'm hoping to them contribute in other areas as I identify other things we can improve.

@RassK
Copy link
Contributor

RassK commented Dec 9, 2025

@martincostello should be also quite familiar with the opamp part. Helped me to shape it. I think if he is fine with changes, don't wait for me.

@Kielek knows the issues of auto inst. side and it's contraints.

So I think it's quite safe to go forward a bit faster.

Copy link
Member

@Kielek Kielek left a comment

Choose a reason for hiding this comment

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

LGTMRS

@Kielek Kielek enabled auto-merge December 9, 2025 13:38
@Kielek Kielek added this pull request to the merge queue Dec 9, 2025
Merged via the queue into open-telemetry:main with commit 9e4119c Dec 9, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:opamp.client Things related to OpenTelemetry.OpAmp.Client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Support configuration of custom HttpClientFactory for OpAmp client

4 participants