[OTLP] Update HttpClientFactory documentation - #7577
Conversation
- 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.
Pull request dashboard statusWaiting on reviewers · refreshed 2026-07-31 19:36 UTC Review the latest changes. Status above doesn't look right?
|
Shorten lines.
| /// 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. |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
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
HttpClientinstances for"OtlpTraceExporter","OtlpMetricExporter", and"OtlpLogExporter"viaAddHttpClient. - Add an IMPORTANT note that custom
DelegatingHandlerimplementations targeting .NET 5+ must override bothSendAsyncandSendto ensure handler logic runs for all OTLP exporter requests. - Update
IOtlpExporterOptionsXML docs to reflect logging registration’sIHttpClientFactorybehavior and theDelegatingHandleroverride 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.
Fixes #7575
Changes
DelegatingHandler.Send().Merge requirement checklist
Unit tests added/updatedAppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)