Package io.helidon.metrics.serviceapi
Class MinimalMetricsSupport
java.lang.Object
io.helidon.servicecommon.rest.HelidonRestServiceSupport
io.helidon.metrics.serviceapi.MinimalMetricsSupport
- All Implemented Interfaces:
MetricsSupport,RestServiceSupport,Service
Minimal implementation of
MetricsSupport.
Apps and other Helidon components which use MetricSupport (such as
the MP metrics component) can very easily take advantage of the minimal implementation of the metrics registries and the
metrics
themselves if metrics is disabled via configuration or settings simply by using the MetricsSupport factory methods
which, based on the metrics settings, might choose this implementation.
This implementation sets up the usual metrics-related endpoints but always sends a 404 response with an explanatory message.
-
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureVendorMetrics(String routingName, Routing.Rules routingRules) Sets up vendor metrics routing using the specified routing name and routing builder.static voidcreateEndpointForDisabledMetrics(String endpointContext, Routing.Rules serviceEndpointRoutingRules) Adds routing rules so metrics-related requests go to the "not available" endpoint.protected voidpostConfigureEndpoint(Routing.Rules defaultRules, Routing.Rules serviceEndpointRoutingRules) Concrete implementations override this method to perform any service-specific routing set-up.voidprepareMetricsEndpoints(String endpointContext, Routing.Rules serviceEndpointRoutingRules) Prepares the family of/metricsendpoints.voidupdate(Routing.Rules rules) UpdatesRouting.Ruleswithhandlersrepresenting this service.Methods inherited from class io.helidon.servicecommon.rest.HelidonRestServiceSupport
configureEndpoint, context, logger, onShutdownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.metrics.serviceapi.MetricsSupport
configureEndpoint
-
Method Details
-
createEndpointForDisabledMetrics
public static void createEndpointForDisabledMetrics(String endpointContext, Routing.Rules serviceEndpointRoutingRules) Adds routing rules so metrics-related requests go to the "not available" endpoint.- Parameters:
endpointContext- web context for metricsserviceEndpointRoutingRules- routing rules for the metrics service
-
postConfigureEndpoint
protected void postConfigureEndpoint(Routing.Rules defaultRules, Routing.Rules serviceEndpointRoutingRules) Description copied from class:HelidonRestServiceSupportConcrete implementations override this method to perform any service-specific routing set-up.- Specified by:
postConfigureEndpointin classHelidonRestServiceSupport- Parameters:
defaultRules- defaultRouting.Rulesto be updatedserviceEndpointRoutingRules- actual rules (if different from the default ones) to be updated for the service endpoint
-
prepareMetricsEndpoints
public void prepareMetricsEndpoints(String endpointContext, Routing.Rules serviceEndpointRoutingRules) Description copied from interface:MetricsSupportPrepares the family of/metricsendpoints.By default, requests to the metrics endpoints trigger a 404 response with an explanatory message that metrics are disabled. Implementations of this interface can provide more informative endpoints.
- Specified by:
prepareMetricsEndpointsin interfaceMetricsSupport- Parameters:
endpointContext- context (typically /metrics)serviceEndpointRoutingRules- routing rules to update with the disabled metrics endpoints
-
update
Description copied from interface:ServiceUpdatesRouting.Ruleswithhandlersrepresenting this service.- Specified by:
updatein interfaceMetricsSupport- Specified by:
updatein interfaceService- Parameters:
rules- a routing rules to update
-
configureVendorMetrics
Description copied from interface:MetricsSupportSets up vendor metrics routing using the specified routing name and routing builder.- Specified by:
configureVendorMetricsin interfaceMetricsSupport- Parameters:
routingName- routing name to use in setting up the vendor metricsroutingRules- routing rules to modify
-