Table of Contents |
---|
Metrics Provider
The Micrometer integration is provided by MicrometerMetricsProvider.
Configuration
There MicrometerMetricsProvider supports the following properties (encapsulated inside MicrometerMetricsProperties).
Property | Description | Default |
---|---|---|
autoTimeRequests | Whether requests handled by CXF should be automatically timed. If the number of time series emitted grows | true |
requestsMetricName | Name of the metric for received requests | cxf.server.requests |
Integration with JAX-WS
The typical way to plug Micrometer integration 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();
MetricsProvider metricsProvider = new MicrometerMetricsProvider(registry, tagsProvider,
Arrays.asList(operationsCustomizer, faultsCustomizer), new DefaultTimedAnnotationProvider(), properties);
EndpointImpl endpoint = new EndpointImpl(bus, new HelloPortImpl(), null, null, new WebServiceFeature[]{
new MetricsFeature(metricsProvider)
}); |