Skip to content

[OTLP] Update HttpClientFactory documentation - #7577

Open
martincostello wants to merge 2 commits into
open-telemetry:mainfrom
martincostello:gh-7575
Open

[OTLP] Update HttpClientFactory documentation#7577
martincostello wants to merge 2 commits into
open-telemetry:mainfrom
martincostello:gh-7575

Conversation

@martincostello

Copy link
Copy Markdown
Member

Fixes #7575

Changes

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)

- Update out-of-date notes about the logging integration (see open-telemetry#7109 and open-telemetry#7298).
- Document that .NET 5+ must override `DelegatingHandler.Send()`.

Resolves open-telemetry#7575.
@martincostello martincostello added the documentation Documentation related label Jul 31, 2026
@github-actions github-actions Bot added pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package and removed documentation Documentation related labels Jul 31, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 31, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-07-31 19:36 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

/// Applications that use custom classes derived from <see cref="DelegatingHandler"/>
/// in .NET 5 or later must override both the asynchronous
/// <see cref="DelegatingHandler.SendAsync(HttpRequestMessage, CancellationToken)"/>
/// and synchronous <c>Send(HttpRequestMessage, CancellationToken)</c> methods.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This uses <c> instead of <see> as the symbol only exists for some TFMs, and dotnet format doesn't like #if constructs in the middle of /// sections.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.38%. Comparing base (fc163d4) to head (8f94e75).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7577      +/-   ##
==========================================
- Coverage   90.44%   90.38%   -0.07%     
==========================================
  Files         290      290              
  Lines       15989    15989              
==========================================
- Hits        14462    14452      -10     
- Misses       1527     1537      +10     
Flag Coverage Δ
unittests-Project-Experimental 90.49% <ø> (ø)
unittests-Project-Stable 90.27% <ø> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

@martincostello
martincostello marked this pull request as ready for review July 31, 2026 08:02
@martincostello
martincostello requested a review from a team as a code owner July 31, 2026 08:02
Copilot AI review requested due to automatic review settings July 31, 2026 08:02
@martincostello
martincostello enabled auto-merge July 31, 2026 08:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates OTLP exporter documentation to reflect current IHttpClientFactory support (including logs) and to clarify DelegatingHandler requirements for .NET 5+ when customizing authentication/headers via handlers.

Changes:

  • Document customizing named HttpClient instances for "OtlpTraceExporter", "OtlpMetricExporter", and "OtlpLogExporter" via AddHttpClient.
  • Add an IMPORTANT note that custom DelegatingHandler implementations targeting .NET 5+ must override both SendAsync and Send to ensure handler logic runs for all OTLP exporter requests.
  • Update IOtlpExporterOptions XML docs to reflect logging registration’s IHttpClientFactory behavior and the DelegatingHandler override requirement.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md Updates IHttpClientFactory guidance to include logs and adds guidance about overriding DelegatingHandler.Send/SendAsync on .NET 5+.
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/IOtlpExporterOptions.cs Updates XML documentation to reflect current logging integration behavior and handler override requirements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] OtlpExporterOptions.HttpClientFactory is invoked but its client is not used for the actual export request

3 participants