[OTLP] Respect configured options in UseOtlpExporter#7540
Merged
martincostello merged 2 commits intoJul 20, 2026
Conversation
Contributor
|
Welcome, contributor! Thank you for your contribution to opentelemetry-dotnet. Important reminders:
|
Pull request dashboard status
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7540 +/- ##
==========================================
- Coverage 90.22% 90.21% -0.02%
==========================================
Files 290 290
Lines 15967 15969 +2
==========================================
Hits 14406 14406
- Misses 1561 1563 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
martincostello
approved these changes
Jul 20, 2026
stevejgordon
approved these changes
Jul 20, 2026
Contributor
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 #6231
Design discussion issue #6231
Changes
I updated
UseOtlpExporterto resolve its defaultOtlpExporterOptionsthrough the registered options pipeline instead of constructing a separate instance. This makesservices.Configure<OtlpExporterOptions>(...)apply to the cross-cutting exporter while preserving signal-specific configuration and fallback behavior.I also added a regression test that builds all three providers and verifies the configured endpoint reaches logging, metrics, and tracing.
Testing
dotnet test test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj --framework net10.0 --no-restore(698 passed, 3 integration tests skipped)dotnet format test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests.csproj --no-restore --verify-no-changespython3 ./build/scripts/sanitycheck.pygit diff --check origin/main...HEADThe full solution matrix, including Windows/.NET Framework targets, is left to CI.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes