Skip to content

Instantly share code, notes, and snippets.

@gbellmann
Created January 29, 2017 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbellmann/ca3959d03502e2021796a6f4a63d38bd to your computer and use it in GitHub Desktop.
Save gbellmann/ca3959d03502e2021796a6f4a63d38bd to your computer and use it in GitHub Desktop.
Helper class to configure Application Insights and our Telemetry Processor
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