Skip to content

Refactor AspNetCore and WorkerService use of Heartbeat (DiagnosticTelemetryModule) #1954

@TimothyMothra

Description

@TimothyMothra

Currently, AspNetCore uses DependencyInjection for configuration for all components except the DiagnosticTelemetryModule which still depends on TelemetryConfiguration.Active.
This dependency is because of the Heartbeat feature.
The other TelemetryModules (AppServicesHeartbeatTelemetryModule and AzureInstanceMetadataTelemetryModule) don't do any real work and use .Active to apply their settings to the Heartbeat manager in the DiagnosticTelemetryModule.
In order to remove AspNetCore's dependency on .Active, the internal configuration will need to correctly configure these Modules using DI.

IMPORTANT: We've been recommending customers use DI to manually configure Heartbeat and DiagnosticTelemetryModule.

services.AddSingleton<ITelemetryModule>(new DiagnosticTelemetryModule());

We will continue to support this scenario.

The end goal is to support Heartbeat in all supported app models: Asp.Net, Asp.Net Core, and Worker-Service.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions