Class MetricsConfig.BuilderBase<BUILDER extends MetricsConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends MetricsConfig>
- 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> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
MetricsConfig.Builder
- Enclosing interface:
MetricsConfig
MetricsConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPublisher(MetricsPublisher publisher) Metrics publishers which make the metrics data available to external systems.addPublishers(List<? extends MetricsPublisher> publishers) Metrics publishers which make the metrics data available to external systems.Hints for role names the user is expected to be in.Global tags.appName()Value for the application tag to be added to each meter ID.Value for the application tag to be added to each meter ID.Name for the application tag to be added to each meter ID.appTagName(String appTagName) Name for the application tag to be added to each meter ID.Output format for built-in meter names.builtInMeterNameFormat(BuiltInMeterNameFormat builtInMeterNameFormat) Output format for built-in meter names.Clear existing value of appName.Clear existing value of appTagName.Clear existing value of jsonUnitsDefault.Clear all publishers.Clear all roles.Clear all tags.config()Metrics configuration node.Deprecated.Update builder from configuration (node of this type).booleanenabled()Whether metrics functionality is enabled.enabled(boolean enabled) Whether metrics functionality is enabled.from(MetricsConfig prototype) Update this builder from an existing prototype instance.from(MetricsConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Deprecated, for removal: This API element is subject to removal in a future version.Provided for backward compatibility only; no replacementgcTimeType(GcTimeType gcTimeType) Deprecated, for removal: This API element is subject to removal in a future version.Provided for backward compatibility only; no replacementDefault units for timer output in JSON if not specified on a given timer.jsonUnitsDefault(TimeUnit jsonUnitsDefault) Default units for timer output in JSON if not specified on a given timer.Key performance indicator metrics settings.keyPerformanceIndicatorMetricsConfig(KeyPerformanceIndicatorMetricsConfig keyPerformanceIndicatorMetricsConfig) Key performance indicator metrics settings.keyPerformanceIndicatorMetricsConfig(Consumer<KeyPerformanceIndicatorMetricsConfig.Builder> consumer) Key performance indicator metrics settings.keyPerformanceIndicatorMetricsConfig(Supplier<? extends KeyPerformanceIndicatorMetricsConfig> supplier) Key performance indicator metrics settings.booleanWhether to allow anybody to access the endpoint.permitAll(boolean permitAll) Whether to allow anybody to access the endpoint.protected voidHandles providers and decorators.Metrics publishers which make the metrics data available to external systems.publishers(List<? extends MetricsPublisher> publishers) Metrics publishers which make the metrics data available to external systems.booleanService discovery flag forpublishers().publishersDiscoverServices(boolean publishersDiscoverServices) Service discovery flag forpublishers().booleanWhether automatic REST request metrics should be measured.restRequestEnabled(boolean restRequestEnabled) Whether automatic REST request metrics should be measured.roles()Hints for role names the user is expected to be in.Hints for role names the user is expected to be in.scoping()Settings related to scoping management.scoping(ScopingConfig scoping) Settings related to scoping management.scoping(Consumer<ScopingConfig.Builder> consumer) Settings related to scoping management.scoping(Supplier<? extends ScopingConfig> supplier) Settings related to scoping management.tags()Global tags.Global tags.toString()protected voidValidates required properties.booleanWhether Helidon should expose meters related to virtual threads.virtualThreadsEnabled(boolean virtualThreadsEnabled) Whether Helidon should expose meters related to virtual threads.Threshold for sampling pinned virtual threads to include in the pinned threads meter.virtualThreadsPinnedThreshold(Duration virtualThreadsPinnedThreshold) Threshold for sampling pinned virtual threads to include in the pinned threads meter.booleanWhether to log warnings when multiple registries are created.warnOnMultipleRegistries(boolean warnOnMultipleRegistries) Whether to log warnings when multiple registries are created.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.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
Deprecated.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 MetricsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends MetricsConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- 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 MetricsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends MetricsConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
enabled
Whether metrics functionality is enabled.- Parameters:
enabled- if metrics are configured to be enabled- Returns:
- updated builder instance
- See Also:
-
permitAll
Whether to allow anybody to access the endpoint.- Parameters:
permitAll- whether to permit access to metrics endpoint to anybody, defaults totrue- Returns:
- updated builder instance
- See Also:
-
clearRoles
Clear all roles.- Returns:
- updated builder instance
- See Also:
-
roles
Hints for role names the user is expected to be in.- Parameters:
roles- list of hints- Returns:
- updated builder instance
- See Also:
-
addRoles
Hints for role names the user is expected to be in.- Parameters:
roles- list of hints- Returns:
- updated builder instance
- See Also:
-
keyPerformanceIndicatorMetricsConfig
public BUILDER keyPerformanceIndicatorMetricsConfig(KeyPerformanceIndicatorMetricsConfig keyPerformanceIndicatorMetricsConfig) Key performance indicator metrics settings.- Parameters:
keyPerformanceIndicatorMetricsConfig- key performance indicator metrics settings- Returns:
- updated builder instance
- See Also:
-
keyPerformanceIndicatorMetricsConfig
public BUILDER keyPerformanceIndicatorMetricsConfig(Consumer<KeyPerformanceIndicatorMetricsConfig.Builder> consumer) Key performance indicator metrics settings.- Parameters:
consumer- consumer of builder of key performance indicator metrics settings- Returns:
- updated builder instance
- See Also:
-
keyPerformanceIndicatorMetricsConfig
public BUILDER keyPerformanceIndicatorMetricsConfig(Supplier<? extends KeyPerformanceIndicatorMetricsConfig> supplier) Key performance indicator metrics settings.- Parameters:
supplier- supplier of key performance indicator metrics settings- Returns:
- updated builder instance
- See Also:
-
clearTags
Clear all tags.- Returns:
- updated builder instance
- See Also:
-
tags
Global tags.- Parameters:
tags- name/value pairs for global tags- Returns:
- updated builder instance
- See Also:
-
addTags
Global tags.- Parameters:
tags- name/value pairs for global tags- Returns:
- updated builder instance
- See Also:
-
clearAppName
Clear existing value of appName.- Returns:
- updated builder instance
- See Also:
-
appName
Value for the application tag to be added to each meter ID.- Parameters:
appName- application tag value- Returns:
- updated builder instance
- See Also:
-
clearAppTagName
Clear existing value of appTagName.- Returns:
- updated builder instance
- See Also:
-
appTagName
Name for the application tag to be added to each meter ID.- Parameters:
appTagName- application tag name- Returns:
- updated builder instance
- See Also:
-
scoping
Settings related to scoping management.- Parameters:
scoping- scoping settings- Returns:
- updated builder instance
- See Also:
-
scoping
Settings related to scoping management.- Parameters:
consumer- consumer of builder of scoping settings- Returns:
- updated builder instance
- See Also:
-
scoping
Settings related to scoping management.- Parameters:
supplier- supplier of scoping settings- Returns:
- updated builder instance
- See Also:
-
restRequestEnabled
Whether automatic REST request metrics should be measured.- Parameters:
restRequestEnabled- true/false- Returns:
- updated builder instance
- See Also:
-
virtualThreadsEnabled
Whether Helidon should expose meters related to virtual threads.- Parameters:
virtualThreadsEnabled- true to include meters related to virtual threads- Returns:
- updated builder instance
- See Also:
-
virtualThreadsPinnedThreshold
Threshold for sampling pinned virtual threads to include in the pinned threads meter.- Parameters:
virtualThreadsPinnedThreshold- threshold used to filter virtual thread pinning events- Returns:
- updated builder instance
- See Also:
-
gcTimeType
Deprecated, for removal: This API element is subject to removal in a future version.Provided for backward compatibility only; no replacementWhether thegc.timemeter should be registered as a gauge (vs. a counter). Thegc.timemeter is inspired by the MicroProfile Metrics spec, in which the meter was originally checked to be a counter but starting in 5.1 was checked be a gauge. For the duration of Helidon 4.x users can choose which type of meter Helidon registers forgc.time.- Parameters:
gcTimeType- the type of meter to use for registeringgc.time- Returns:
- updated builder instance
- See Also:
-
builtInMeterNameFormat
Output format for built-in meter names.BuiltInMeterNameFormat.SNAKEselects "snake_case" which does not conform to the MicroProfile Metrics specification.- Parameters:
builtInMeterNameFormat- the output format for built-in meter names- Returns:
- updated builder instance
- See Also:
-
clearJsonUnitsDefault
Clear existing value of jsonUnitsDefault.- Returns:
- updated builder instance
- See Also:
-
jsonUnitsDefault
Default units for timer output in JSON if not specified on a given timer.If the configuration key is absent, the Helidon JSON output uses
TimeUnit.SECONDS. If the configuration key is present, Helidon formats each timer using that timer's specific units (if set) and the config value otherwise.- Parameters:
jsonUnitsDefault- defaultTimeUnitto use for JSON timer output- Returns:
- updated builder instance
- See Also:
-
warnOnMultipleRegistries
Whether to log warnings when multiple registries are created.By far most applications use a single meter registry, but certain app or library programming errors can cause Helidon to create more than one. By default, Helidon logs warning messages for each additional meter registry created. This setting allows users with apps that need multiple meter registries to suppress those warnings.
- Parameters:
warnOnMultipleRegistries- whether to log warnings upon creation of multiple meter registries- Returns:
- updated builder instance
- See Also:
-
clearPublishers
Clear all publishers.- Returns:
- updated builder instance
- See Also:
-
publishers
Metrics publishers which make the metrics data available to external systems. Helidon's Micrometer-based metrics provider includesmicrometer-prometheus(used by default) andmicrometer-otlp. See the config reference entries forio.helidon.metrics.providers.micrometer.PrometheusPublisherandio.helidon.metrics.providers.micrometer.OtlpPublisher.- Parameters:
publishers- metrics publishers- Returns:
- updated builder instance
- See Also:
-
addPublishers
Metrics publishers which make the metrics data available to external systems. Helidon's Micrometer-based metrics provider includesmicrometer-prometheus(used by default) andmicrometer-otlp. See the config reference entries forio.helidon.metrics.providers.micrometer.PrometheusPublisherandio.helidon.metrics.providers.micrometer.OtlpPublisher.- Parameters:
publishers- metrics publishers- Returns:
- updated builder instance
- See Also:
-
addPublisher
Metrics publishers which make the metrics data available to external systems. Helidon's Micrometer-based metrics provider includesmicrometer-prometheus(used by default) andmicrometer-otlp. See the config reference entries forio.helidon.metrics.providers.micrometer.PrometheusPublisherandio.helidon.metrics.providers.micrometer.OtlpPublisher.- Parameters:
publisher- add single metrics publishers- Returns:
- updated builder instance
- See Also:
-
publishersDiscoverServices
Service discovery flag forpublishers(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Parameters:
publishersDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
enabled
public boolean enabled()Whether metrics functionality is enabled.- Returns:
- if metrics are configured to be enabled
-
permitAll
public boolean permitAll()Whether to allow anybody to access the endpoint.- Returns:
- whether to permit access to metrics endpoint to anybody, defaults to
true - See Also:
-
roles
Hints for role names the user is expected to be in.- Returns:
- list of hints
-
keyPerformanceIndicatorMetricsConfig
Key performance indicator metrics settings.- Returns:
- key performance indicator metrics settings
-
tags
Global tags.- Returns:
- name/value pairs for global tags
-
appName
Value for the application tag to be added to each meter ID.- Returns:
- application tag value
-
appTagName
Name for the application tag to be added to each meter ID.- Returns:
- application tag name
-
scoping
Settings related to scoping management.- Returns:
- scoping settings
-
restRequestEnabled
public boolean restRequestEnabled()Whether automatic REST request metrics should be measured.- Returns:
- true/false
-
virtualThreadsEnabled
public boolean virtualThreadsEnabled()Whether Helidon should expose meters related to virtual threads.- Returns:
- true to include meters related to virtual threads
-
virtualThreadsPinnedThreshold
Threshold for sampling pinned virtual threads to include in the pinned threads meter.- Returns:
- threshold used to filter virtual thread pinning events
-
config
Metrics configuration node.- Returns:
- metrics configuration
-
gcTimeType
Deprecated, for removal: This API element is subject to removal in a future version.Provided for backward compatibility only; no replacementWhether thegc.timemeter should be registered as a gauge (vs. a counter). Thegc.timemeter is inspired by the MicroProfile Metrics spec, in which the meter was originally checked to be a counter but starting in 5.1 was checked be a gauge. For the duration of Helidon 4.x users can choose which type of meter Helidon registers forgc.time.- Returns:
- the type of meter to use for registering
gc.time
-
builtInMeterNameFormat
Output format for built-in meter names.BuiltInMeterNameFormat.SNAKEselects "snake_case" which does not conform to the MicroProfile Metrics specification.- Returns:
- the output format for built-in meter names
-
jsonUnitsDefault
Default units for timer output in JSON if not specified on a given timer.If the configuration key is absent, the Helidon JSON output uses
TimeUnit.SECONDS. If the configuration key is present, Helidon formats each timer using that timer's specific units (if set) and the config value otherwise.- Returns:
- default
TimeUnitto use for JSON timer output
-
warnOnMultipleRegistries
public boolean warnOnMultipleRegistries()Whether to log warnings when multiple registries are created.By far most applications use a single meter registry, but certain app or library programming errors can cause Helidon to create more than one. By default, Helidon logs warning messages for each additional meter registry created. This setting allows users with apps that need multiple meter registries to suppress those warnings.
- Returns:
- whether to log warnings upon creation of multiple meter registries
-
publishers
Metrics publishers which make the metrics data available to external systems. Helidon's Micrometer-based metrics provider includesmicrometer-prometheus(used by default) andmicrometer-otlp. See the config reference entries forio.helidon.metrics.providers.micrometer.PrometheusPublisherandio.helidon.metrics.providers.micrometer.OtlpPublisher.- Returns:
- metrics publishers
-
publishersDiscoverServices
public boolean publishersDiscoverServices()Service discovery flag forpublishers(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Returns:
- whether to enable automatic service discovery
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
config(io.helidon.config.Config)