How Azure Application Insights cost our company 4k USD in a couple of weeks

public void Configure(IApplicationBuilder app, IHostingEnvironment env, TelemetryConfiguration configuration)
{
var builder = configuration.TelemetryProcessorChainBuilder;

// Using adaptive sampling
builder.UseAdaptiveSampling(maxTelemetryItemsPerSecond:5);

builder.Build();

// If you have other telemetry processors:
builder.Use((next) => new AnotherProcessor(next));
// ...
}

Adaptive Sampling — or the gun Microsoft gave me

public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
IOptionsMonitor<TelemetryConfiguration> telemetryConfiguration)
{
TelemetryProcessorChainBuilder
builder = telemetryConfiguration.CurrentValue.DefaultTelemetrySink.TelemetryProcessorChainBuilder;
builder.UseAdaptiveSampling(
excludedTypes: "Trace"
);
builder.Build();
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store