ffang commented on code in PR #3010:
URL: https://github.com/apache/cxf/pull/3010#discussion_r3030112338


##########
rt/features/metrics/src/main/java/org/apache/cxf/metrics/micrometer/MicrometerMetricsProvider.java:
##########
@@ -59,15 +59,33 @@ public MicrometerMetricsProvider(MeterRegistry registry,
     /**
      * {@inheritDoc}
      */
+
     @Override
     public MetricsContext createEndpointContext(Endpoint endpoint, boolean 
asClient, String clientId) {
         if (asClient) {
             return null;
-        } else {
-            return new MicrometerServerMetricsContext(registry, tagsProvider, 
timedAnnotationProvider, tagsCustomizers,
-                micrometerMetricsProperties.getServerRequestsMetricName(), 
-                micrometerMetricsProperties.isAutoTimeRequests());
         }
+        // For JAX-RS server endpoints, createResourceContext() is invoked per

Review Comment:
   Hi @reta ,
   
   Thanks for the feedback!
   Yes, we can extract the logic and move up to higher layer. This commit 
https://github.com/apache/cxf/pull/3010/commits/829561775181a620eea05130b4bc048557d30981
 also revised existing JaxRs Metrics tests as we don't need to create 
endpointContext for jaxrs endpoints.
   
   Freeman
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to