internal HttpCoreDiagnosticSourceSubscriber(HttpCoreDiagnosticSourceListener listener, ApplicationInsightsUrlFilter applicationInsightsUrlFilter)
            {
                this.httpDiagnosticListener       = listener;
                this.applicationInsightsUrlFilter = applicationInsightsUrlFilter;

                var httpClientVersion = typeof(HttpClient).GetTypeInfo().Assembly.GetName().Version;

                this.isNetCore20HttpClient = httpClientVersion.CompareTo(new Version(4, 2)) >= 0;

                try
                {
                    this.listenerSubscription = DiagnosticListener.AllListeners.Subscribe(this);
                }
                catch (Exception ex)
                {
                    DependencyCollectorEventSource.Log.HttpCoreDiagnosticSubscriberFailedToSubscribe(ex.ToInvariantString());
                }
            }
Esempio n. 2
0
            internal HttpCoreDiagnosticSourceSubscriber(
                HttpCoreDiagnosticSourceListener listener,
                ApplicationInsightsUrlFilter applicationInsightsUrlFilter,
                bool isNetCore20HttpClient)
            {
                this.httpDiagnosticListener       = listener;
                this.applicationInsightsUrlFilter = applicationInsightsUrlFilter;

                this.isNetCore20HttpClient = isNetCore20HttpClient;

                try
                {
                    this.listenerSubscription = DiagnosticListener.AllListeners.Subscribe(this);
                }
                catch (Exception ex)
                {
                    DependencyCollectorEventSource.Log.HttpCoreDiagnosticSubscriberFailedToSubscribe(ex.ToInvariantString());
                }
            }
Esempio n. 3
0
            internal HttpCoreDiagnosticSourceSubscriber(
                HttpCoreDiagnosticSourceListener listener,
                ApplicationInsightsUrlFilter applicationInsightsUrlFilter,
                HttpInstrumentationVersion httpInstrumentationVersion)
            {
                this.httpDiagnosticListener       = listener;
                this.applicationInsightsUrlFilter = applicationInsightsUrlFilter;

                this.httpInstrumentationVersion = httpInstrumentationVersion;

                try
                {
                    this.listenerSubscription = DiagnosticListener.AllListeners.Subscribe(this);
                }
                catch (Exception ex)
                {
                    DependencyCollectorEventSource.Log.HttpCoreDiagnosticSubscriberFailedToSubscribe(ex.ToInvariantString());
                }

                SubscriptionManager.Attach(this.httpDiagnosticListener);
            }
 internal HttpCoreDiagnosticSourceSubscriber(HttpCoreDiagnosticSourceListener listener)
 {
     this.httpDiagnosticListener = listener;
     this.listenerSubscription   = DiagnosticListener.AllListeners.Subscribe(this);
 }