NoUsers/Sessions count - Azure WCF webservice behind a Azure Traffic manager


we have azure wcf webservice being consumed windows phone app , when enabled app insights user , session count either 0 or 1. reporting correct users/sessions/geographic info not supported pure webservice or because our webservice behind azure traffic manager.

hello forg2,

if i'm not mistaken (it changed couple time during ai lifetime), latest version of ai web sdk, users tracked via ai javascript sdk adds certain cookies on client meaning if web service not have user tracking ai on client side, users not tracked automatically server side.

however, believe can submit user information manually using ai telemetry initializer (e.g. in sample code, authenticated user extracted):

public class mytelemetryinitializer : microsoft.applicationinsights.extensibility.itelemetryinitializer {     public void initialize(microsoft.applicationinsights.channel.itelemetry telemetry)     {         string user = null;         if (httpcontext.current != null)         {             if (httpcontext.current.user != null)             {                 user = httpcontext.current.user.identity.name;                 telemetry.context.user.id = user;             }         }         if (user != null)         {             telemetry.context.user.accountid = user;         }     } }

then, add initializer applicationinsights.config , called of telemetry items create configuration. can scope telemetry initializer down telemetry type need checking telemetry type in initialize() like:

if (telemetry requesttelemetry) { }
more on telemetry initializers here.


dmitry matveev



Visual Studio Development  ,  Visual Studio Team Foundation Server  >  Application Insights (AI)



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'