Class MetricsObserverConfig.BuilderBase<BUILDER extends MetricsObserverConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsObserverConfig>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
- Direct Known Subclasses:
MetricsObserverConfig.Builder
- Enclosing interface:
MetricsObserverConfig
MetricsObserverConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class ObserverConfigBase.BuilderBase
ObserverConfigBase.BuilderBase.ObserverConfigBaseImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAutomatic metrics collection settings.autoHttpMetrics(AutoHttpMetricsConfig autoHttpMetrics) Automatic metrics collection settings.autoHttpMetrics(Consumer<AutoHttpMetricsConfig.Builder> consumer) Automatic metrics collection settings.autoHttpMetrics(Supplier<? extends AutoHttpMetricsConfig> supplier) Automatic metrics collection settings.Clear existing value of autoHttpMetrics.Clear existing value of meterRegistry.Update builder from configuration (node of this type).endpoint()Endpoint option.Endpoint option.from(MetricsObserverConfig prototype) Update this builder from an existing prototype instance.from(MetricsObserverConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.If you want to have multiple meter registries with different endpoints, you may create them usingwhereMeterRegistry meterRegistry = io.helidon.service.registry.Services .get(io.helidon.metrics.api.MetricsFactory.class) .createMeterRegistry(metricsConfig); MetricsObserver.builder() .endpoint("metrics-2") .metricsConfig(metricsConfig) .meterRegistry(meterRegistry) // further settings on the observer builder, etc. .build();metricsConfigcan contain registry-specific settings.meterRegistry(MeterRegistry meterRegistry) If you want to have multiple meter registries with different endpoints, you may create them usingwhereMeterRegistry meterRegistry = io.helidon.service.registry.Services .get(io.helidon.metrics.api.MetricsFactory.class) .createMeterRegistry(metricsConfig); MetricsObserver.builder() .endpoint("metrics-2") .metricsConfig(metricsConfig) .meterRegistry(meterRegistry) // further settings on the observer builder, etc. .build();metricsConfigcan contain registry-specific settings.Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls.metricsConfig(MetricsConfig metricsConfig) Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls.metricsConfig(Consumer<MetricsConfig.Builder> consumer) Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls.metricsConfig(Supplier<? extends MetricsConfig> supplier) Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls.protected voidHandles providers and decorators.toString()protected voidValidates required properties.Methods inherited from class ObserverConfigBase.BuilderBase
config, enabled, enabled, from, from, name, nameModifier and TypeMethodDescriptionconfig()The config instance used to configure this observer.booleanenabled()Whether this observer is enabled.enabled(boolean enabled) Whether this observer is enabled.from(ObserverConfigBase prototype) Update this builder from an existing prototype instance.from(ObserverConfigBase.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.name()Name of this observer.Name of this observer.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends MetricsObserverConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsObserverConfig>- Overrides:
configin classObserverConfigBase.BuilderBase<BUILDER extends MetricsObserverConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsObserverConfig>- Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
endpoint
-
clearAutoHttpMetrics
Clear existing value of autoHttpMetrics.- Returns:
- updated builder instance
- See Also:
-
autoHttpMetrics
Automatic metrics collection settings.- Parameters:
autoHttpMetrics- auto metrics collection settings- Returns:
- updated builder instance
- See Also:
-
autoHttpMetrics
Automatic metrics collection settings.- Parameters:
consumer- consumer of builder of auto metrics collection settings- Returns:
- updated builder instance
- See Also:
-
autoHttpMetrics
Automatic metrics collection settings.- Parameters:
supplier- supplier of auto metrics collection settings- Returns:
- updated builder instance
- See Also:
-
metricsConfig
Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls. With a customMeterRegistry, the settings also describe the registry-specific behavior. With the shared registry, registry-specific behavior uses the settings from that registry's owningMetricsFactorywhile the endpoint settings assigned here still apply.- Parameters:
metricsConfig- metrics settings for the observer endpoint and, when configured, a custom registry- Returns:
- updated builder instance
- See Also:
-
metricsConfig
Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls. With a customMeterRegistry, the settings also describe the registry-specific behavior. With the shared registry, registry-specific behavior uses the settings from that registry's owningMetricsFactorywhile the endpoint settings assigned here still apply.- Parameters:
consumer- consumer of builder of metrics settings for the observer endpoint and, when configured, a custom registry- Returns:
- updated builder instance
- See Also:
-
metricsConfig
Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls. With a customMeterRegistry, the settings also describe the registry-specific behavior. With the shared registry, registry-specific behavior uses the settings from that registry's owningMetricsFactorywhile the endpoint settings assigned here still apply.- Parameters:
supplier- supplier of metrics settings for the observer endpoint and, when configured, a custom registry- Returns:
- updated builder instance
- See Also:
-
clearMeterRegistry
Clear existing value of meterRegistry.- Returns:
- updated builder instance
- See Also:
-
meterRegistry
If you want to have multiple meter registries with different endpoints, you may create them usingwhereMeterRegistry meterRegistry = io.helidon.service.registry.Services .get(io.helidon.metrics.api.MetricsFactory.class) .createMeterRegistry(metricsConfig); MetricsObserver.builder() .endpoint("metrics-2") .metricsConfig(metricsConfig) .meterRegistry(meterRegistry) // further settings on the observer builder, etc. .build();metricsConfigcan contain registry-specific settings. Configure a differentendpoint()on each observer.A meter registry has one effective set of registry-specific settings. Multiple metrics observers may share the same registry only when their registry-specific settings are equivalent; endpoint settings may differ. Use separate meter registries for observers that require different registry-specific behavior.
A custom meter registry passed to an observer remains caller-owned. Close it after all observers using it have stopped.
If this method is not called, a registry-managed
MetricsObserveruses the shared instance from its owningServiceRegistry. A directly created observer uses the global shared instance as provided byServices.get(MeterRegistry.class).- Parameters:
meterRegistry- meterRegistry to use in this metric support- Returns:
- updated builder instance
- See Also:
-
endpoint
-
autoHttpMetrics
Automatic metrics collection settings.- Returns:
- auto metrics collection settings
-
metricsConfig
Assigns metrics settings for the observer endpoint, including whether the endpoint is enabled and its access controls. With a customMeterRegistry, the settings also describe the registry-specific behavior. With the shared registry, registry-specific behavior uses the settings from that registry's owningMetricsFactorywhile the endpoint settings assigned here still apply.- Returns:
- metrics settings for the observer endpoint and, when configured, a custom registry
-
meterRegistry
If you want to have multiple meter registries with different endpoints, you may create them usingwhereMeterRegistry meterRegistry = io.helidon.service.registry.Services .get(io.helidon.metrics.api.MetricsFactory.class) .createMeterRegistry(metricsConfig); MetricsObserver.builder() .endpoint("metrics-2") .metricsConfig(metricsConfig) .meterRegistry(meterRegistry) // further settings on the observer builder, etc. .build();metricsConfigcan contain registry-specific settings. Configure a differentendpoint()on each observer.A meter registry has one effective set of registry-specific settings. Multiple metrics observers may share the same registry only when their registry-specific settings are equivalent; endpoint settings may differ. Use separate meter registries for observers that require different registry-specific behavior.
A custom meter registry passed to an observer remains caller-owned. Close it after all observers using it have stopped.
If this method is not called, a registry-managed
MetricsObserveruses the shared instance from its owningServiceRegistry. A directly created observer uses the global shared instance as provided byServices.get(MeterRegistry.class).- Returns:
- meterRegistry to use in this metric support
-
toString
- Overrides:
toStringin classObserverConfigBase.BuilderBase<BUILDER extends MetricsObserverConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsObserverConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classObserverConfigBase.BuilderBase<BUILDER extends MetricsObserverConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsObserverConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classObserverConfigBase.BuilderBase<BUILDER extends MetricsObserverConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsObserverConfig>
-