-
Notifications
You must be signed in to change notification settings - Fork 293
Description
The heartbeat relies on IHeartbeatPropertyManager being available on TelemetryModules.Instance.Modules, however this collection is empty when you add AI using services.AddApplicationInsightsTelemetryWorkerService().
You can make it work by adding, for example, var _ = TelemetryConfiguration.Active;, which initialises TelemetryConfigurationFactory adds the DiagnosticsTelemetryModule to the modules collection. However, TelemetryConfiguration.Active is obsolete and this does not seem like the correct thing to do. You would expect it to just work?
Repro Steps
- Add application insights to worker service using
services.AddApplicationInsightsTelemetryWorkerService() - Deploy service to VM
- Look for "HeartbeatState" in customMetrics
Actual Behavior
No HeartbeatState appears in customMetrics
Expected Behavior
HeartbeatState appear in customMeterics
Version Info
SDK Version : 2.12.1
.NET Version : Core 3.1
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : Visual Studio
OS : Windows
Hosting Info (IIS/Azure WebApps/ etc) : Windows VM Service