Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/OpenTelemetry/Sdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Diagnostics;
using OpenTelemetry.Context.Propagation;
using OpenTelemetry.Internal;
using OpenTelemetry.Logs;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;

Expand Down Expand Up @@ -83,5 +84,19 @@ public static TracerProviderBuilder CreateTracerProviderBuilder()
{
return new TracerProviderBuilderBase();
}

/// <summary>
/// Creates a <see cref="LoggerProviderBuilder"/> which is used to build
/// an <see cref="LoggerProvider"/>. In a typical application, a single
/// <see cref="LoggerProvider"/> is created at application startup and
/// disposed at application shutdown. It is important to ensure that the
/// provider is not disposed too early.
/// </summary>
/// <returns><see cref="LoggerProviderBuilder"/> instance, which is used
/// 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 😭

}
}
}