Support worker roles through HostBuilder #708
Description
openedon Jun 22, 2018
Starting with NET Core 2.1, the concept of HostBuilder/Host was introduced:
https://www.stevejgordon.co.uk/using-generic-host-in-dotnet-core-console-based-microservices
It decouples host creation and management (DI, configuration) from the Asp.NET Core and HTTP stack and enables worker role scenarios.
Application Insights AspNet Core SDK should be split into 2 packages:
-
first one that works for any app and configures everything not specific to HTTP server: majority of telemetry initializers, dependency collection, performance counter collection, heartbeats, quick pulse, sampling. .Net Full Fx apps perhaps may also benefit from it.
-
second one that depends on AspNetCore and enables http: request collection, JS injection, etc...
Perfect example where this is needed Azure WebJobs/Functions: they don't necessarily have http stack and have to configure the SDK from scratch.