public void RddTestHttpProcessingFrameworkOnBeginSkipsAddingSourceHeaderPerConfig()
        {
            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 httpProcessingFramework = new FrameworkHttpProcessing(this.configuration, new CacheBasedOperationHolder("tempCache1", 100 * 1000), /*setCorrelationHeaders*/ false, new List <string>(), RandomAppIdEndpoint);

            httpProcessingFramework.OnRequestSend(request);
            Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
            Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());

            ICollection <string> exclusionList = new SanitizedHostList()
            {
                "randomstringtoexclude", hostnamepart
            };

            httpProcessingFramework = new FrameworkHttpProcessing(this.configuration, new CacheBasedOperationHolder("tempCache2", 100 * 1000), /*setCorrelationHeaders*/ true, exclusionList, RandomAppIdEndpoint);
            httpProcessingFramework.OnRequestSend(request);
            Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
            Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());
        }
 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, new CacheBasedOperationHolder());
 }
 internal HttpDesktopDiagnosticSourceListener(FrameworkHttpProcessing httpProcessing)
 {
     this.httpProcessingFramework     = httpProcessing;
     this.subscribeHelper             = new HttpDesktopDiagnosticSourceSubscriber(this);
     this.requestFetcherRequestEvent  = new PropertyFetcher("Request");
     this.requestFetcherResponseEvent = new PropertyFetcher("Request");
     this.responseFetcher             = new PropertyFetcher("Response");
 }
예제 #4
0
 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, new CacheBasedOperationHolder());
 }
 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;
 }
        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, new CacheBasedOperationHolder("testCache", 100 * 1000), /*setCorrelationHeaders*/ true, new List <string>(), RandomAppIdEndpoint);
            var correlationIdLookupHelper = new CorrelationIdLookupHelper((string ikey) =>
            {
                // Pretend App Id is the same as Ikey
                var tcs = new TaskCompletionSource <string>();
                tcs.SetResult(ikey);
                return(tcs.Task);
            });

            this.httpProcessingFramework.OverrideCorrelationIdLookupHelper(correlationIdLookupHelper);
        }
예제 #7
0
 internal FrameworkHttpEventListener(FrameworkHttpProcessing frameworkHttpProcessing)
 {
     this.HttpProcessingFramework = frameworkHttpProcessing;
 }
 internal FrameworkHttpEventListener(TelemetryConfiguration configuration)
 {
     this.HttpProcessingFramework = new FrameworkHttpProcessing(configuration, DependencyTableStore.Instance.WebRequestCacheHolder);
 }
 internal FrameworkHttpEventListener(TelemetryConfiguration configuration)
 {
     this.HttpProcessingFramework = new FrameworkHttpProcessing(configuration, DependencyTableStore.Instance.WebRequestCacheHolder);
 }
 internal FrameworkHttpEventListener(TelemetryConfiguration configuration, CacheBasedOperationHolder telemetryTupleHolder)
 {
     this.HttpProcessingFramework = new FrameworkHttpProcessing(configuration, telemetryTupleHolder);
 }