Skip to content

[OTLP] Respect configured options in UseOtlpExporter#7540

Merged
martincostello merged 2 commits into
open-telemetry:mainfrom
w3lld1:fix/use-otlp-configure-options
Jul 20, 2026
Merged

[OTLP] Respect configured options in UseOtlpExporter#7540
martincostello merged 2 commits into
open-telemetry:mainfrom
w3lld1:fix/use-otlp-configure-options

Conversation

@w3lld1

@w3lld1 w3lld1 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #6231
Design discussion issue #6231

Changes

I updated UseOtlpExporter to resolve its default OtlpExporterOptions through the registered options pipeline instead of constructing a separate instance. This makes services.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-changes
  • python3 ./build/scripts/sanitycheck.py
  • git diff --check origin/main...HEAD

The full solution matrix, including Windows/.NET Framework targets, is left to CI.

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 (not applicable; no public API change)

@w3lld1
w3lld1 requested a review from a team as a code owner July 18, 2026 18:02
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 18, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-dotnet.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.

@github-actions github-actions Bot added the pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package label Jul 18, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 18, 2026

Copy link
Copy Markdown

Pull request dashboard status

  • Status: Merged.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.21%. Comparing base (687b41b) to head (a0121a3).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests-Project-Experimental 90.26% <100.00%> (-0.02%) ⬇️
unittests-Project-Stable 90.16% <100.00%> (-0.16%) ⬇️

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

Files with missing lines Coverage Δ
...enTelemetryProtocol/Builder/OtlpExporterBuilder.cs 100.00% <100.00%> (ø)
...etryProtocol/Builder/OtlpExporterBuilderOptions.cs 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@martincostello martincostello changed the title [Exporter.OTLP] Respect configured options in UseOtlpExporter [OTLP] Respect configured options in UseOtlpExporter Jul 20, 2026
@martincostello
martincostello added this pull request to the merge queue Jul 20, 2026
Merged via the queue into open-telemetry:main with commit f101632 Jul 20, 2026
66 checks passed
@otelbot

otelbot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @w3lld1! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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] UseOtlpExporter is not respecting services.Configure<OtlpExporterOptions> but AddOtlpExporter does

3 participants