Describe the bug
In Paramore.Brighter.Extensions.DependencyInjection.ServiceCollectionExtensions method Tracer line 903 Brighter attempts to get a registered BrighterTracer to construct an IAmAnOutBoxProducerMediator in method BuildOutBoxProducerMediator.
What is registered in Paramore.Brighter.Extensions.Diagnostics.AddBrighterInstrumentation is an IAmABrighterTracer and that's what code in other places of those service collection extensions looks for.
Getting around this problem requires a double-registration like this, of a service that should be registered automatically in AddBrighterInstrumentation.
var tracer = new BrighterTracer(TimeProvider.System);
builder.Services.AddSingleton<BrighterTracer>(tracer);
builder.Services.AddSingleton<IAmABrighterTracer>(tracer);
Otherwise the mediator is injected with a null tracer and subsequent spans aren't associated with the parent trace.
Describe the bug
In
Paramore.Brighter.Extensions.DependencyInjection.ServiceCollectionExtensionsmethodTracerline 903 Brighter attempts to get a registeredBrighterTracerto construct anIAmAnOutBoxProducerMediatorin methodBuildOutBoxProducerMediator.What is registered in
Paramore.Brighter.Extensions.Diagnostics.AddBrighterInstrumentationis anIAmABrighterTracerand that's what code in other places of those service collection extensions looks for.Getting around this problem requires a double-registration like this, of a service that should be registered automatically in
AddBrighterInstrumentation.Otherwise the mediator is injected with a null tracer and subsequent spans aren't associated with the parent trace.