Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PropertyDescriptionDefault
autoTimeRequests

Whether requests handled by CXF should be automatically timed.  If the number of time series emitted grows
too large on account of request mapping timings, set it to "false" and use @Timed or @TimeSet on a per
invocation basis as needed.

true
requestsMetricNameserverRequestsMetricNameName of the metric for received requests (server-side)cxf.server.requests

Integration with JAX-WS

Server

The typical way to plug Micrometer integration on the server-side is by using WebServiceFeature mechanism, for which there is a dedicated MetricsFeature implementation. The snipped below illustrated the basic initialization sequence and set of the dependencies involved.

Code Block
final MeterRegistry registry = ...; /* Micrometer MeterRegistry  instance */
        
final JaxwsTags jaxwsTags = new JaxwsTags();
final TagsCustomizer operationsCustomizer = new JaxwsOperationTagsCustomizer(jaxwsTags);
final TagsCustomizer faultsCustomizer = new JaxwsFaultCodeTagsCustomizer(jaxwsTags, new JaxwsFaultCodeProvider());
        
final TagsProvider tagsProvider = new StandardTagsProvider(new DefaultExceptionClassProvider(), new StandardTags()); 
final MicrometerMetricsProperties properties = new MicrometerMetricsProperties();
        
final MetricsProvider metricsProvider = new MicrometerMetricsProvider(registry, tagsProvider, 
     Arrays.asList(operationsCustomizer, faultsCustomizer), new DefaultTimedAnnotationProvider(), properties);

final JAXWSServerFactoryBean factory = new JAXWSServerFactoryBean();
factory.setWsFeatures(Arrays.asList(new MetricsFeature(metricsProvider)));
...

Alternatively, the MetricsFeature could be supplied directly to JAX-WS endpoint, for example:

Code Block
EndpointImpl endpoint = new EndpointImpl(bus, new HelloPortImpl(), null, null, new WebServiceFeature[]{
    new MetricsFeature(metricsProvider)
});

Client

No supported at the moment

Integration with JAX-RS

Server

The typical way to plug Micrometer integration  on the server-side is by using AbstractFeature which is implemented by MetricsFeature. The snipped below illustrated the basic initialization sequence and set of the dependencies involved.

Code Block
final MeterRegistry registry = ...; /* Micrometer MeterRegistry  instance */
        
final JaxrsTags jaxrsTags = new JaxrsTags();
final TagsCustomizer operationsCustomizer = new JaxrsOperationTagsCustomizer(jaxrsTags);
        
final TagsProvider tagsProvider = new StandardTagsProvider(new DefaultExceptionClassProvider(), new StandardTags()); 
final MicrometerMetricsProperties properties = new MicrometerMetricsProperties();
        
final MetricsProvider metricsProvider = new MicrometerMetricsProvider(registry, tagsProvider, 
     Arrays.asList(operationsCustomizer), new DefaultTimedAnnotationProvider(), properties);

final JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
factory.setFeatures(Arrays.asList(new MetricsFeature(metricsProvider)));

Client

No fully supported at the moment