You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal static class OpenTelemetryBuilderServiceProviderExtensions
{
public static void EnsureSingleUseOtlpExporterRegistration(this IServiceProvider serviceProvider)
{
var registrations = serviceProvider.GetServices<UseOtlpExporterRegistration>();
if (registrations.Count() > 1)
{
throw new NotSupportedException("Multiple calls to UseOtlpExporter on the same IServiceCollection are not supported.");
}
}
public static void EnsureNoUseOtlpExporterRegistrations(this IServiceProvider serviceProvider)
{
var registrations = serviceProvider.GetServices<UseOtlpExporterRegistration>();
if (registrations.Any())
{
throw new NotSupportedException("Signal-specific AddOtlpExporter methods and the cross-cutting UseOtlpExporter method being invoked on the same IServiceCollection is not supported.");