/// <summary> /// Initialize for framework event source (not supported for Net40). /// </summary> private void InitializeForDiagnosticAndFrameworkEventSource() { if (!this.DisableDiagnosticSourceInstrumentation) { DesktopDiagnosticSourceHttpProcessing desktopHttpProcessing = new DesktopDiagnosticSourceHttpProcessing( this.telemetryConfiguration, DependencyTableStore.Instance.WebRequestCacheHolder, this.SetComponentCorrelationHttpHeaders, this.ExcludeComponentCorrelationHttpHeadersOnDomains, this.EnableLegacyCorrelationHeadersInjection, this.EnableRequestIdHeaderInjectionInW3CMode); this.httpDesktopDiagnosticSourceListener = new HttpDesktopDiagnosticSourceListener(desktopHttpProcessing, new ApplicationInsightsUrlFilter(this.telemetryConfiguration)); } FrameworkHttpProcessing frameworkHttpProcessing = new FrameworkHttpProcessing( this.telemetryConfiguration, DependencyTableStore.Instance.WebRequestCacheHolder, this.SetComponentCorrelationHttpHeaders, this.ExcludeComponentCorrelationHttpHeadersOnDomains, this.EnableLegacyCorrelationHeadersInjection); // In 4.5 EventListener has a race condition issue in constructor so we retry to create listeners this.httpEventListener = RetryPolicy.Retry <InvalidOperationException, TelemetryConfiguration, FrameworkHttpEventListener>( config => new FrameworkHttpEventListener(frameworkHttpProcessing), this.telemetryConfiguration, TimeSpan.FromMilliseconds(10)); this.sqlEventListener = RetryPolicy.Retry <InvalidOperationException, TelemetryConfiguration, FrameworkSqlEventListener>( config => new FrameworkSqlEventListener(config, DependencyTableStore.Instance.SqlRequestCacheHolder, this.EnableSqlCommandTextInstrumentation), this.telemetryConfiguration, TimeSpan.FromMilliseconds(10)); }
/// <summary> /// Initialize for framework event source (not supported for Net40). /// </summary> private void InitializeForDiagnosticAndFrameworkEventSource() { #if NET45 if (!this.DisableDiagnosticSourceInstrumentation) { DesktopDiagnosticSourceHttpProcessing desktopHttpProcessing = new DesktopDiagnosticSourceHttpProcessing( this.telemetryConfiguration, DependencyTableStore.Instance.WebRequestCacheHolder, this.SetComponentCorrelationHttpHeaders, this.ExcludeComponentCorrelationHttpHeadersOnDomains, this.EffectiveProfileQueryEndpoint); this.httpDesktopDiagnosticSourceListener = new HttpDesktopDiagnosticSourceListener(desktopHttpProcessing); } FrameworkHttpProcessing frameworkHttpProcessing = new FrameworkHttpProcessing( this.telemetryConfiguration, DependencyTableStore.Instance.WebRequestCacheHolder, this.SetComponentCorrelationHttpHeaders, this.ExcludeComponentCorrelationHttpHeadersOnDomains, this.EffectiveProfileQueryEndpoint); // In 4.5 EventListener has a race condition issue in constructor so we retry to create listeners this.httpEventListener = RetryPolicy.Retry <InvalidOperationException, TelemetryConfiguration, FrameworkHttpEventListener>( config => new FrameworkHttpEventListener(frameworkHttpProcessing), this.telemetryConfiguration, TimeSpan.FromMilliseconds(10)); this.sqlEventListener = RetryPolicy.Retry <InvalidOperationException, TelemetryConfiguration, FrameworkSqlEventListener>( config => new FrameworkSqlEventListener(config, DependencyTableStore.Instance.SqlRequestCacheHolder), this.telemetryConfiguration, TimeSpan.FromMilliseconds(10)); #endif }
public void TestInitialize() { this.configuration = new TelemetryConfiguration() { TelemetryChannel = new StubTelemetryChannel { OnSend = item => this.sendItems.Add(item) }, InstrumentationKey = TestInstrumentationKey, ApplicationIdProvider = new MockApplicationIdProvider(TestInstrumentationKey, TestApplicationId) }; this.httpProcessingFramework = new FrameworkHttpProcessing(this.configuration, this.cache, /*setCorrelationHeaders*/ true, new List <string>()); DependencyTableStore.IsDesktopHttpDiagnosticSourceActivated = false; }
public void TestInitialize() { this.configuration = new TelemetryConfiguration(); this.sendItems = new List <ITelemetry>(); this.configuration.TelemetryChannel = new StubTelemetryChannel { OnSend = item => this.sendItems.Add(item) }; this.configuration.InstrumentationKey = Guid.NewGuid().ToString(); this.httpProcessingFramework = new FrameworkHttpProcessing(this.configuration, this.cache, /*setCorrelationHeaders*/ true, new List <string>(), RandomAppIdEndpoint); this.httpProcessingFramework.OverrideCorrelationIdLookupHelper(new CorrelationIdLookupHelper(new Dictionary <string, string> { { this.configuration.InstrumentationKey, "cid-v1:" + this.configuration.InstrumentationKey } })); DependencyTableStore.IsDesktopHttpDiagnosticSourceActivated = false; }