Helper class to configure Application Insights and our Telemetry Processor
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
using System.Configuration; | |
using Microsoft.ApplicationInsights.Extensibility; | |
namespace Samples.App_Start | |
{ | |
public static class AppInsightsConfig | |
{ | |
public static void RegisterAppInsights() | |
{ | |
TelemetryConfiguration.Active.InstrumentationKey = | |
System.Web.Configuration.WebConfigurationManager.AppSettings["ApplicationInsightsKey"]; | |
var builder = TelemetryConfiguration.Active.TelemetryProcessorChainBuilder; | |
builder.Use(next => new My404Filter(next)); | |
builder.Build(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment