Class MicrometerSupport
- java.lang.Object
-
- io.helidon.servicecommon.rest.HelidonRestServiceSupport
-
- io.helidon.integrations.micrometer.MicrometerSupport
-
- All Implemented Interfaces:
RestServiceSupport
,Service
public class MicrometerSupport extends HelidonRestServiceSupport
Implements simple Micrometer support.Developers create Micrometer
MeterRegistry
objects and enroll them withMicrometerSupport.Builder
, providing with each enrollment a HelidonHandler
for expressing the registry's data in an HTTP response.Alternatively, developers can enroll any of the built-in registries represented by the
MeterRegistryFactory.BuiltInRegistryType
enum.Having enrolled Micrometer meter registries with
MicrometerSupport.Builder
and built theMicrometerSupport
object, developers can invoke theregistry()
method and use the returnedMeterRegistry
to create or locate meters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MicrometerSupport.Builder
Fluid builder forMicrometerSupport
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MicrometerSupport.Builder
builder()
Fluid builder forMicrometerSupport
.static MicrometerSupport
create()
Creates a newMicrometerSupport
using default settings.static MicrometerSupport
create(Config config)
Creates a newMicrometerSupport
using the providedConfig
(anchored at the "metrics.micrometer" node).protected void
postConfigureEndpoint(Routing.Rules defaultRules, Routing.Rules serviceEndpointRoutingRules)
Concrete implementations override this method to perform any service-specific routing set-up.io.micrometer.core.instrument.MeterRegistry
registry()
Returns the composite registry so apps can create and register meters on it.void
update(Routing.Rules rules)
UpdatesRouting.Rules
withhandlers
representing this service.-
Methods inherited from class io.helidon.servicecommon.rest.HelidonRestServiceSupport
configureEndpoint, configureEndpoint, context, logger, onShutdown
-
-
-
-
Method Detail
-
builder
public static MicrometerSupport.Builder builder()
Fluid builder forMicrometerSupport
.- Returns:
- Builder
-
create
public static MicrometerSupport create()
Creates a newMicrometerSupport
using default settings.- Returns:
- default MicrometerSupport
-
create
public static MicrometerSupport create(Config config)
Creates a newMicrometerSupport
using the providedConfig
(anchored at the "metrics.micrometer" node).- Parameters:
config
- Config settings for Micrometer set-up- Returns:
- newly-created MicrometerSupport
-
registry
public io.micrometer.core.instrument.MeterRegistry registry()
Returns the composite registry so apps can create and register meters on it.- Returns:
- the composite registry
-
update
public void update(Routing.Rules rules)
Description copied from interface:Service
UpdatesRouting.Rules
withhandlers
representing this service.- Parameters:
rules
- a routing rules to update
-
postConfigureEndpoint
protected void postConfigureEndpoint(Routing.Rules defaultRules, Routing.Rules serviceEndpointRoutingRules)
Description copied from class:HelidonRestServiceSupport
Concrete implementations override this method to perform any service-specific routing set-up.- Specified by:
postConfigureEndpoint
in classHelidonRestServiceSupport
- Parameters:
defaultRules
- defaultRouting.Rules
to be updatedserviceEndpointRoutingRules
- actual rules (if different from the default ones) to be updated for the service endpoint
-
-