Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdk-logs] Add Sdk.CreateLoggerProviderBuilder #4464

Conversation

CodeBlanch
Copy link
Member

Relates to #4433

Changes

  • Adds Sdk.CreateLoggerProviderBuilder API

Merge requirement checklist

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

@CodeBlanch CodeBlanch requested a review from a team May 4, 2023 22:24
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #4464 (f42ac8d) into main (8f4d83a) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4464   +/-   ##
=======================================
  Coverage   83.32%   83.32%           
=======================================
  Files         314      314           
  Lines       12524    12525    +1     
=======================================
+ Hits        10435    10437    +2     
+ Misses       2089     2088    -1     
Impacted Files Coverage Δ
...metry/Logs/BatchExportLogRecordProcessorOptions.cs 100.00% <ø> (ø)
src/OpenTelemetry/Sdk.cs 93.75% <0.00%> (-6.25%) ⬇️

... and 7 files with indirect coverage changes

src/OpenTelemetry/Sdk.cs Outdated Show resolved Hide resolved
/// to build a <see cref="LoggerProvider"/>.</returns>
internal static LoggerProviderBuilder CreateLoggerProviderBuilder()
{
return new LoggerProviderServiceCollectionBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we rename LoggerProviderServiceCollectionBuilder to LoggerProviderBuilderBase to stay consistent with Traces and Metrics?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can, but I would prefer not to. Here is the reasoning...

If you look at the 1.3.1 branch, hosting used to have two classes TracerProviderBuilderHosting and MeterProviderBuilderHosting. Those used the TracerProviderBuilderBase & MeterProviderBuilderBase base classes which were shipped public.

Things changed in 1.4 and we no longer use inheritance to make this stuff work. The new LoggerProviderServiceCollectionBuilder doesn't need to ever be made public (it is sealed class).

So we could rename it LoggerProviderBuilderBase but that would be misleading IMO because it isn't a base class thing. I picked the current name because I thought it better reflected the design and made things more understandable (at the cost of some consistency). I would rename TracerProviderBuilderBase & MeterProviderBuilderBase if I could be we already shipped them stable 😭

Copy link
Contributor

@utpilla utpilla left a comment

Choose a reason for hiding this comment

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

Approving to unblock progress. The renaming of LoggerProviderServiceCollectionBuilder class could be done in a follow-up PR if it's feasible.

@cijothomas cijothomas merged commit c501cb3 into open-telemetry:main May 5, 2023
@CodeBlanch CodeBlanch deleted the sdk-logs-CreateLoggerProviderBuilder branch May 5, 2023 16:21
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.

5 participants