NoUsers/Sessions count - Azure WCF webservice behind a 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
Post a Comment