Nodejs Azure Application Insights black-out

Suddenly all our trackings of one nodejs webjob stopped. Unfortunately Application Insights isn't really verbose even if not working at all. As we lost much effort on investigating on this issue, let's share.

  • Other webjob (C#) hosted on the same App Service send correctly telemetry. Not related to any network/communication of the App Service itself.
  • Seems purely nodejs related, first action, update npm packages (see below)
  • No luck ... created a new simple nodejs script pushing fake information to insights ... working as expected ...

I've struggled to find a way to have verbose information. I've found a reference of verboseLogging in this thread : https://github.com/Microsoft/ApplicationInsights-node.js/issues/16

appInsights.config.enableDebug = true;  
appInsights.config.verboseLogging = true;  

I suspect that this isn't supported anymore but finally by looking in module source code, I found what I was looking for

appInsights.enableVerboseLogging();  

and suddenly, hurray, error messages

ApplicationInsights:Sender [ { host: 'dc.services.visualstudio.com',  
    port: null,
    path: '/v2/track',
    method: 'POST',
    headers: 
     { 'Content-Type': 'application/x-json-stream',
       'Content-Encoding': 'gzip',
       'Content-Length': 1774 } } ]
ApplicationInsights:Sender [ '<head><title>Document Moved</title></head>\n<body><h1>Object Moved</h1>This document may be found <a HREF="https://dc.services.visualstudio.com/v2/track">here</a></body>' ]  
ApplicationInsights:Sender [ { host: 'dc.services.visualstudio.com',  
    port: null,
    path: '/v2/track',
    method: 'POST',
    headers: 
     { 'Content-Type': 'application/x-json-stream',
       'Content-Encoding': 'gzip',
       'Content-Length': 2237 } } ]
ApplicationInsights:Sender [ '<head><title>Document Moved</title></head>\n<body><h1>Object Moved</h1>This document may be found <a HREF="https://dc.services.visualstudio.com/v2/track">here</a></body>' ]  

Document moved ... what is my version

  • Deployed : 0.15.19
  • Latest : 0.17

But I've just update npm modules few days before ... but I suspect my webjob wasn't cleanly stopped and some node processes were still on preventing a clean npm update command to run.

Fabien Camous

Read more posts by this author.