This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Start() | |
{ | |
AreaRegistration.RegisterAllAreas(); | |
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); | |
RouteConfig.RegisterRoutes(RouteTable.Routes); | |
BundleConfig.RegisterBundles(BundleTable.Bundles); | |
TelemetryConfiguration.Active.TelemetryInitializers.Add(new ClientIpHeaderTelemetryInitializer()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TelemetryInitializers> | |
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureWebAppRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer" /> | |
<Add Type="Microsoft.ApplicationInsights.Web.WebTestTelemetryInitializer, Microsoft.AI.Web" /> | |
<Add Type="Microsoft.ApplicationInsights.Web.SyntheticUserAgentTelemetryInitializer, Microsoft.AI.Web"> | |
<Filters>search|spider|crawl|Bot|Monitor|AlwaysOn</Filters> | |
</Add> | |
<Add Type="Microsoft.ApplicationInsights.Web.ClientIpHeaderTelemetryInitializer, Microsoft.AI.Web" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TelemetryProcessors> | |
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector" /> | |
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel"> | |
<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond> | |
</Add> | |
<Add Type="ApplicationInsightDemoSite.NotFoundFilter, ApplicationInsightDemoSite" /> | |
</TelemetryProcessors> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$(".home-page-link").click(function() { | |
window.appInsights.trackEvent("homePageLinkClicked", $(this).text()); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
[AllowAnonymous] | |
[ValidateAntiForgeryToken] | |
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl) | |
{ | |
if (!ModelState.IsValid) | |
{ | |
return View(model); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpPost] | |
[AllowAnonymous] | |
[ValidateAntiForgeryToken] | |
public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model) | |
{ | |
if (ModelState.IsValid) | |
{ | |
var postVariables = Request.Form.ToString(); | |
var dic = new Dictionary<string, string>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Start() | |
{ | |
AreaRegistration.RegisterAllAreas(); | |
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); | |
RouteConfig.RegisterRoutes(RouteTable.Routes); | |
BundleConfig.RegisterBundles(BundleTable.Bundles); | |
TelemetryConfiguration.Active.TelemetryInitializers.Add(new ClientIpHeaderTelemetryInitializer()); | |
var builder = TelemetryConfiguration.Active.TelemetryProcessorChainBuilder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Implements initialization logic. | |
/// </summary> | |
/// <param name="platformContext">Http context.</param> | |
/// <param name="requestTelemetry">Request telemetry object associated with the current request.</param> | |
/// <param name="telemetry">Telemetry item to initialize.</param> | |
protected override void OnInitializeTelemetry(HttpContext platformContext, RequestTelemetry requestTelemetry, ITelemetry telemetry) | |
{ | |
if (string.IsNullOrEmpty(telemetry.Context.Location.Ip)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NotFoundFilter : ITelemetryProcessor | |
{ | |
private ITelemetryProcessor Next { get; set; } | |
public NotFoundFilter(ITelemetryProcessor next) | |
{ | |
this.Next = next; | |
} | |
public void Process(ITelemetry item) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
public class AiHandleErrorAttribute : HandleErrorAttribute | |
{ | |
public override void OnException(ExceptionContext filterContext) | |
{ | |
if (filterContext != null && filterContext.HttpContext != null && filterContext.Exception != null) | |
{ | |
if (filterContext.HttpContext.IsCustomErrorEnabled) | |
{ | |
var ai = new TelemetryClient(); |
OlderNewer