public void RddTestHttpDesktopProcessingFrameworkOnBeginSkipsAddingSourceHeaderPerConfig() { string hostnamepart = "partofhostname"; string url = string.Format(CultureInfo.InvariantCulture, "http://hostnamestart{0}hostnameend.com/path/to/something?param=1", hostnamepart); var request = WebRequest.Create(new Uri(url)); Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]); Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count()); var localHttpProcessingFramework = new DesktopDiagnosticSourceHttpProcessing( this.configuration, new CacheBasedOperationHolder("testCache", 100 * 1000), false, new List <string>(), RandomAppIdEndpoint); localHttpProcessingFramework.OnBegin(request); Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]); Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Count(x => x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase))); ICollection <string> exclusionList = new SanitizedHostList() { "randomstringtoexclude", hostnamepart }; localHttpProcessingFramework = new DesktopDiagnosticSourceHttpProcessing( this.configuration, new CacheBasedOperationHolder("testCache", 100 * 1000), true, exclusionList, RandomAppIdEndpoint); localHttpProcessingFramework.OnBegin(request); Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]); Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Count(x => x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase))); }
internal HttpDesktopDiagnosticSourceListener(DesktopDiagnosticSourceHttpProcessing httpProcessing, ApplicationInsightsUrlFilter applicationInsightsUrlFilter) { this.httpDesktopProcessing = httpProcessing; this.subscribeHelper = new HttpDesktopDiagnosticSourceSubscriber(this, applicationInsightsUrlFilter); this.requestFetcherRequestEvent = new PropertyFetcher("Request"); this.requestFetcherResponseEvent = new PropertyFetcher("Request"); this.responseFetcher = new PropertyFetcher("Response"); }
internal HttpDesktopDiagnosticSourceListener(DesktopDiagnosticSourceHttpProcessing httpProcessing) { this.httpDesktopProcessing = httpProcessing; this.subscribeHelper = new HttpDesktopDiagnosticSourceSubscriber(this); this.requestFetcherRequestEvent = new PropertyFetcher("Request"); this.requestFetcherResponseEvent = new PropertyFetcher("Request"); this.responseFetcher = new PropertyFetcher("Response"); }
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.httpDesktopProcessingFramework = new DesktopDiagnosticSourceHttpProcessing(this.configuration, new CacheBasedOperationHolder("testCache", 100 * 1000), /*setCorrelationHeaders*/ true, new List <string>(), RandomAppIdEndpoint); this.httpDesktopProcessingFramework.OverrideCorrelationIdLookupHelper(new CorrelationIdLookupHelper(new Dictionary <string, string> { { this.configuration.InstrumentationKey, "cid-v1:" + this.configuration.InstrumentationKey } })); DependencyTableStore.IsDesktopHttpDiagnosticSourceActivated = false; }