3
votes

I have created a Cloud Service project with following roles:

  • One Web role
  • One Worker role

For both the roles, I have added Azure Application Insights SDK/ Nuget pkg. I have also added the Status Monitor to both of them, StartUp task. Two roles point to different AI resources. For Worker role I also added the below three environment variables in csdef file.

<Environment>
        <Variable name="COR_ENABLE_PROFILING" value="1" />
        <Variable name="COR_PROFILER" value="{324F817A-7420-4E6D-B3C1-143FBED6D855}" />
        <Variable name="MicrosoftInstrumentationEngine_Host" value="{CA487940-57D2-10BF-11B2-A3AD5A13CBC0}" />
</Environment>

The problems is unlike Web role, Worker role doesn't populate the CPU usage/Available memory in Application Insights, as can be shown below.

Application Insights resource of Worker Role:

enter image description here

What can be the issue and can I use any GUID in the environment variables shown above?

Also, it seems that for worker roles we need to set the ApplicationInsights.config file to be copied always to the output directory. However, when I do that, worker role throws the task exception and keeps on restarting, which finally fails the deployment.

1
Is it possible that you need to start profiling within the worker role? Perhaps web roles do it automatically? When I search for COR_PROFILER I keep finding people referencing this env variable also: COR_PROFILER_PATH which you don't have definedThraka
And, are you starting telemetry gathering on the OnStart of the worker role according to this? github.com/Microsoft/ApplicationInsights-Home/blob/master/…Thraka
Copying ApplicationInsights.config solved my problem. What error throws when you deploy WR?cdiazal

1 Answers

1
votes

1) In order to collect the performance counters account that you worker role process (WaWorkerHost.exe) running under should be part of Performance Monitor users group.

Take a look at the thread below: it explains how to modify start up task (InstallAgent.ps1) to give the right permissions. It's done for the web role, so you'll need to replace $user = "Network Service" with the right account in your case.

add Azure Application insight Status Monitor from command line

2) No, you cannot use any GUID for env variable. It's predefined COM object GUID of AppInsights profiler.