TasksTracker.Processor.Backend.Svc/AppInsightsTelemetryInitializer.cs (15 lines of code) (raw):
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
namespace TasksTracker.Processor.Backend.Svc
{
public class AppInsightsTelemetryInitializer : ITelemetryInitializer
{
public void Initialize(ITelemetry telemetry)
{
if (string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName))
{
//set custom role name here
telemetry.Context.Cloud.RoleName = "tasksmanager-backend-processor";
}
}
}
}