@Kundan Pitroda - Welcome to Microsoft Q&A and thanks for reaching out.
By looking at it, it looks like at this moment, there is an issue involving this telemetry module.
And I also see that one of our engineers have already responded to you in other forum, resurfacing it here for broader audience.
Here is a temporary workaround for WorkerServices that will help you.
- Add application insights to worker service using
services.AddApplicationInsightsTelemetryWorkerService().
- Not only this DiagnosticsTelemetryModule adding to DI and also we need to configure it's heartbeat interval/module using the below code: services.TryAddSingleton<ITelemetryModule, DiagnosticsTelemetryModule>();
services.ConfigureTelemetryModule<DiagnosticsTelemetryModule>((mod,opt) => mod.HeartbeatInterval = TimeSpan.FromSeconds(30));
services.AddApplicationInsightsTelemetryWorkerService(); - The TelemetryConfiguration.Active is not recommended because Worker service is new SDK, its not touching active or any other static singletons.
For tracking purposed, after Deploying, Look for "HeartbeatState" in customMetrics.
Note:
Disabling DiagnosticsTelemetryModule will cause the following settings to be ignored:
- EnableHeartbeat,
- EnableAzureInstanceMetadataTelemetryModule,
- EnableAppServicesHeartbeatTelemetryModule.
- Enable Azure Monitor from the Portal.
Please take a look at the below docs for more reference:
worker-service
Enabling Heartbeat in App Services
Hope this helps.
------------------------------------------------------------------
If the above response was helpful, please feel free to "Accept as Answer" and "Upvote" the same so it can be beneficial to the community.
@Kundan Pitroda - Did the below answer help resolve your issue, if not please revert back with any questions.
and if it did, please feel free to "accept as answer" so it can be beneficial to the community.