user10285265
user10285265

Reputation:

<no role name> under Roles in ApplicationInsights

I am seeing some strange exceptions from a role which I have no idea how to interpret. The role name RD........ under , what can I expect that to be ? Is it the underlying machine which all my service in that specific service group is running on top of ?

enter image description here

Upvotes: 5

Views: 4212

Answers (1)

bharathn-msft
bharathn-msft

Reputation: 972

The Application Insights SDK or Agent attempts to automatically add the cloud role name property to the telemetry emitted by components in an Azure App Service environment.

With out fully understanding the architecture you have it might be difficult to call out what "no role name" could be. Possible reason might be if Application Insights SDK or Agent is not able to determine the exact role of the component emitting the telemetry you might end up seeing the no role name, however in those cases you can always set or override cloud role name manually.

using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;

namespace CustomInitializer.Telemetry
{
   public class MyTelemetryInitializer : ITelemetryInitializer
   {
      public void Initialize(ITelemetry telemetry)
       {
          if (string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName))
          {
            //set custom role name here
            telemetry.Context.Cloud.RoleName = "Custom RoleName";
            telemetry.Context.Cloud.RoleInstance = "Custom RoleInstance";
         }
       }
   }
}

Please refer to this documentation for additional reference. Also for information on how to override the cloud role name property with telemetry initializers, see Add properties: ITelemetryInitializer.

Hope this information helps, please feel free to revert back if you have any further queries.

Upvotes: 3

Related Questions