Skip to content

Instantly share code, notes, and snippets.

@hiraldesai
hiraldesai / DependencyResponseInitializer.cs
Created August 12, 2018 20:05
Application Insights Telemetry Initializer to capture responses from outbound http calls (dependencies)
public class DependencyResponseInitializer : ITelemetryInitializer
{
private readonly bool _dependencyResponseCaptureDisabled;
public DependencyResponseInitializer(IConfiguration configuration)
{
bool.TryParse(configuration[Constants.ConfigKeys.DependencyResponseCapturingDisabled], out _dependencyResponseCaptureDisabled);
}
public void Initialize(ITelemetry telemetry)