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
Hello,
for our .Net Maui App we are intending to add custom Log Exporter and Processor. We would like to have this DI-aware so that we configure the ServiceCollection to know the CustomExporter (ConfigureServices) and resolve instances via the DI-Container at Build time; the ConfigureBuilder, where we get the ServiceProvider and we could use it to resolve any instance. Here is a snippet of the desired code:
loggerProviderBuilder.ConfigureServices(services =>
{
// the DatabaseExporter has a dependency to a DBStorage Service which configured elsewhere ...
services.AddSingleton<IDatabaseExporter, DatabaseExporter>();
});
loggerProviderBuilder.ConfigureBuilder((sp, builder) =>
{
builder.AddProcessor((sp) =>
{
// the DI container takes care of creating the Database exporter and injects all the dependencies ...
var dbLogExporter = sp.GetRequiredService<IDatabaseExporter>();
var inMemExporter = CreateInMemoryExporter(dbLogExporter);
var processor = new BatchLogRecordExportProcessor(inMemExporter);
return processor;
});
....
Question:
There is the OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions class implementing extension methods marked as experimental features allowing to ConfigureServices and ConfigureBuilder exactly the way we need it...
What about the plans for making these not experimental anymore ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
for our .Net Maui App we are intending to add custom Log Exporter and Processor. We would like to have this DI-aware so that we configure the ServiceCollection to know the CustomExporter (ConfigureServices) and resolve instances via the DI-Container at Build time; the ConfigureBuilder, where we get the ServiceProvider and we could use it to resolve any instance. Here is a snippet of the desired code:
loggerProviderBuilder.ConfigureServices(services =>
{
// the DatabaseExporter has a dependency to a DBStorage Service which configured elsewhere ...
services.AddSingleton<IDatabaseExporter, DatabaseExporter>();
});
loggerProviderBuilder.ConfigureBuilder((sp, builder) =>
{
builder.AddProcessor((sp) =>
{
// the DI container takes care of creating the Database exporter and injects all the dependencies ...
var dbLogExporter = sp.GetRequiredService<IDatabaseExporter>();
var inMemExporter = CreateInMemoryExporter(dbLogExporter);
....
Question:
There is the OpenTelemetryDependencyInjectionLoggerProviderBuilderExtensions class implementing extension methods marked as experimental features allowing to ConfigureServices and ConfigureBuilder exactly the way we need it...
What about the plans for making these not experimental anymore ?
Beta Was this translation helpful? Give feedback.
All reactions