Issue with Otlp exporter when configured using builder.Services.ConfigureOpenTelemetryTracerProvider
#4503
Labels
bug
Something isn't working
Bug Report
Tested with 1.4.0 on
.NET7.0
Symptom
A clear and concise description of what the bug is.
System.NotSupportedException: 'Services cannot be configured after ServiceProvider has been created.'
exception is thrown when otlp exporter is configured usingbuilder.Services.ConfigureOpenTelemetryTracerProvider
alongsideservices.AddOpenTelemetry().WithTracing
What is the expected behavior?
Traces are exported to both console and otlp exporter.
What is the actual behavior?
Startup error
Reproduce
Create a new ASP.NET Core app and add following lines
The behavior is same with
builder.Services.ConfigureOpenTelemetryMeterProvider((sp, builder) => builder.AddOtlpExporter());
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: