Beispiel #1
0
        public static void AddPerformanceCountersApm(this HttpConfiguration configuration, string applicationName, bool addResponseHeaders)
        {
            ApmContextHttpMessageExtractor.AddExtractor();

            ApmHttpClientApmContextExtensions.ApmHttpClientDelegatingHandlerFactories.Add(new PerformanceCounterApmHttpClientDelegatingHandlerFactory());
            ApmMethodHandlerApmContextExtensions.ApmMethodHttpFactories.Add(new PerformanceCounterApmMethodHandlerFactory());

            PerformanceCounterApmApiFilterAttribute.ApplicationName    = applicationName;
            PerformanceCounterApmApiFilterAttribute.AddResponseHeaders = addResponseHeaders;

            PerformanceCounterApmHttpClientDelegatingHandler.ApplicationName = applicationName;

            PerformanceCounterApmMethodHandler.ApplicationName = applicationName;

            var performanceCounterApmApiFilterAttribute = new PerformanceCounterApmApiFilterAttribute();

            configuration.Filters.Add(performanceCounterApmApiFilterAttribute);
        }
Beispiel #2
0
        public static void AddNoOperationApm(this HttpConfiguration configuration, string applicationName, bool addResponseHeaders)
        {
            ApmContextHttpMessageExtractor.AddExtractor();

            ApmHttpClientApmContextExtensions.ApmHttpClientDelegatingHandlerFactories.Add(new NoOperationApmHttpClientDelegatingHandlerFactory());
            ApmMethodHandlerApmContextExtensions.ApmMethodHttpFactories.Add(new NoOperationApmMethodHandlerFactory());

            NoOperationApmApiFilterAttribute.ApplicationName    = applicationName;
            NoOperationApmApiFilterAttribute.AddResponseHeaders = addResponseHeaders;

            NoOperationApmHttpClientDelegatingHandler.ApplicationName = applicationName;

            NoOperationApmMethodHandler.ApplicationName = applicationName;

            var noOperationApmApiFilterAttribute = new NoOperationApmApiFilterAttribute();

            configuration.Filters.Add(noOperationApmApiFilterAttribute);

            configuration.Services.Add(typeof(IExceptionLogger), new NoOperationApmExceptionLogger());
        }