Skip to content

Conversation

@CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Jun 1, 2023

Relates to #4433

Changes

  • Removes the auto-registration of OTel ILoggerProvider when calling WithLogging

Details

@alanwest and I felt like this behavior needed more discussion.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (nullable enabled, static analysis, etc.)

@CodeBlanch CodeBlanch requested a review from a team June 1, 2023 17:53
@CodeBlanch CodeBlanch changed the title [hosting] Don't register ILogger when calling WithLogging [hosting-logs] Don't register ILogger when calling WithLogging Jun 1, 2023
Copy link
Member

@alanwest alanwest left a comment

Choose a reason for hiding this comment

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

LGTM

Just elaborating on our reasoning a bit more to remind my future self...

Having WithLogging have the side effect of turning on ILogger support may be undesirable to some users. For example, maybe a user is using EventSource and ILogger in their application and they only want EventSource integrated with OTel - enabling ILogger in WithLogging prevents this scenario. This scenario may seem unlikely, but I do not see a strong reason to prevent it.

@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #4535 (e5c0e77) into main (ccfbcc6) will increase coverage by 0.03%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4535      +/-   ##
==========================================
+ Coverage   85.57%   85.60%   +0.03%     
==========================================
  Files         320      320              
  Lines       12611    12610       -1     
==========================================
+ Hits        10792    10795       +3     
+ Misses       1819     1815       -4     
Impacted Files Coverage Δ
...lemetry.Extensions.Hosting/OpenTelemetryBuilder.cs 89.65% <ø> (-0.35%) ⬇️

... and 4 files with indirect coverage changes

@CodeBlanch CodeBlanch merged commit 9b5c483 into open-telemetry:main Jun 1, 2023
@CodeBlanch CodeBlanch deleted the hosting-withlogging-iloggerstartup branch June 1, 2023 19:27
mfogliatto pushed a commit to mfogliatto/opentelemetry-dotnet that referenced this pull request Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants