[Exporter.OTLP] Enable IHttpClientFactory for OtlpLogExporter#7109
Open
nquandt wants to merge 8 commits intoopen-telemetry:mainfrom
Open
[Exporter.OTLP] Enable IHttpClientFactory for OtlpLogExporter#7109nquandt wants to merge 8 commits intoopen-telemetry:mainfrom
nquandt wants to merge 8 commits intoopen-telemetry:mainfrom
Conversation
…ing Microsoft.Extensions.Http 8.0.0+
…xporter to #if NET8_0_OR_GREATER
d822c52 to
72f0081
Compare
Co-authored-by: Martin Costello <[email protected]>
Co-authored-by: Martin Costello <[email protected]>
Author
|
Took all suggestions and resolved merge conflicts. 👍 |
martincostello
approved these changes
Apr 18, 2026
Author
|
Sorry looks like I had missed a lint check. Removed an extra space in the changelog. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7109 +/- ##
==========================================
- Coverage 88.86% 88.80% -0.07%
==========================================
Files 271 271
Lines 12980 12981 +1
==========================================
- Hits 11535 11528 -7
- Misses 1445 1453 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
Design discussion issue #
Changes
Prior to .NET 8, DefaultHttpClientFactory took ILoggerFactory as a constructor argument, causing a circular dependency when used from the log export path:
ILoggerFactory -> OpenTelemetryLoggerProvider -> OtlpLogExporter
-> IHttpClientFactory -> ILoggerFactory
.NET 8 removed that constructor dependency by deferring ILoggerFactory resolution via a Lazy field (dotnet/runtime#89531).
We can just check
#if NET_8_0_OR_GREATERbefore calling TryEnableIHttpClientFactoryIntegration, bringing OtlpLogExporter to parity with the trace and metrics exporters.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)