Class MetricsConfig.BuilderBase.MetricsConfigImpl
java.lang.Object
io.helidon.metrics.api.MetricsConfig.BuilderBase.MetricsConfigImpl
- All Implemented Interfaces:
Prototype.Api, MetricsConfig
- Enclosing class:
MetricsConfig.BuilderBase<BUILDER extends MetricsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsConfig>
protected static class MetricsConfig.BuilderBase.MetricsConfigImpl
extends Object
implements MetricsConfig
Generated implementation of the prototype, can be extended by descendant prototype implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface MetricsConfig
MetricsConfig.Builder, MetricsConfig.BuilderBase<BUILDER, PROTOTYPE>Modifier and TypeInterfaceDescriptionstatic classFluent API builder forMetricsConfig.static classMetricsConfig.BuilderBase<BUILDER extends MetricsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsConfig>Fluent API builder base forMetricsConfig. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeUnitDefault JSON unit.static final StringConfig key for KPI metrics settings.static final StringThe config key containing settings for all of metrics.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Core metrics ignores scope configuration, and this constant will be removed. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetricsConfigImpl(MetricsConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionappName()Value for the application tag to be added to each meter ID.Name for the application tag to be added to each meter ID.Output format for built-in meter names.config()Metrics configuration node.booleanenabled()Whether metrics functionality is enabled.booleaninthashCode()Default units for timer output in JSON if not specified on a given timer.Key performance indicator metrics settings.booleanWhether to allow anybody to access the metrics endpoint when this config is used by a metrics observer.Metrics publishers which make the metrics data available to external systems.booleanWhether automatic REST request metrics should be measured.roles()Role names allowed to access the metrics endpoint when this config is used by a metrics observer andMetricsConfig.permitAll()isfalse.scoping()Deprecated, for removal: This API element is subject to removal in a future version.tags()Global tags.toString()booleanWhether Helidon should expose meters related to virtual threads.Threshold for sampling pinned virtual threads to include in the pinned threads meter.booleanWhether to log warnings when multiple registries are created.Methods inherited from interface MetricsConfig
isMeterEnabled, isMeterEnabled, isScopeEnabled, lookupConfig, publishersConfiguredModifier and TypeMethodDescriptiondefault booleanisMeterEnabled(String name) Determines whether the meter with the specified name is enabled.default booleanisMeterEnabled(String name, String scope) Deprecated, for removal: This API element is subject to removal in a future version.default booleanisScopeEnabled(String scope) Deprecated, for removal: This API element is subject to removal in a future version.Core metrics does not apply scope filtering, and this method will be removed.lookupConfig(String key) Looks up a single config value within the metrics configuration by config key.default booleanIndicates if publishers were specified, either by the application adding any programmatically or if the config contained thepublishersnode.
-
Field Details
-
METRICS_CONFIG_KEY
The config key containing settings for all of metrics.- See Also:
-
SCOPE_CONFIG_KEY
Deprecated, for removal: This API element is subject to removal in a future version.Core metrics ignores scope configuration, and this constant will be removed.Legacy scope configuration key retained for compatibility.- See Also:
-
KEY_PERFORMANCE_INDICATORS_CONFIG_KEY
Config key for KPI metrics settings.- See Also:
-
DEFAULT_JSON_UNITS_DEFAULT
Default JSON unit.
-
-
Constructor Details
-
MetricsConfigImpl
Create an instance providing a builder.- Parameters:
builder- extending builder base of this prototype
-
-
Method Details
-
enabled
public boolean enabled()Description copied from interface:MetricsConfigWhether metrics functionality is enabled.- Specified by:
enabledin interfaceMetricsConfig- Returns:
- if metrics are configured to be enabled
-
permitAll
public boolean permitAll()Description copied from interface:MetricsConfigWhether to allow anybody to access the metrics endpoint when this config is used by a metrics observer. This setting has no effect in the top-levelmetricsconfig which controls the shared registry.- Specified by:
permitAllin interfaceMetricsConfig- Returns:
- whether to permit access to the observer's metrics endpoint to anybody, defaults to
true - See Also:
-
roles
Description copied from interface:MetricsConfigRole names allowed to access the metrics endpoint when this config is used by a metrics observer andMetricsConfig.permitAll()isfalse. This setting has no effect in the top-levelmetricsconfig which controls the shared registry.- Specified by:
rolesin interfaceMetricsConfig- Returns:
- allowed role names
-
keyPerformanceIndicatorMetricsConfig
Description copied from interface:MetricsConfigKey performance indicator metrics settings.- Specified by:
keyPerformanceIndicatorMetricsConfigin interfaceMetricsConfig- Returns:
- key performance indicator metrics settings
-
tags
Description copied from interface:MetricsConfigGlobal tags.- Specified by:
tagsin interfaceMetricsConfig- Returns:
- name/value pairs for global tags
-
appName
Description copied from interface:MetricsConfigValue for the application tag to be added to each meter ID.- Specified by:
appNamein interfaceMetricsConfig- Returns:
- application tag value
-
appTagName
Description copied from interface:MetricsConfigName for the application tag to be added to each meter ID.- Specified by:
appTagNamein interfaceMetricsConfig- Returns:
- application tag name
-
scoping
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:MetricsConfigReturns scope settings retained for compatibility; core metrics ignores them.- Specified by:
scopingin interfaceMetricsConfig- Returns:
- configured scope settings
-
restRequestEnabled
public boolean restRequestEnabled()Description copied from interface:MetricsConfigWhether automatic REST request metrics should be measured.- Specified by:
restRequestEnabledin interfaceMetricsConfig- Returns:
- true/false
-
virtualThreadsEnabled
public boolean virtualThreadsEnabled()Description copied from interface:MetricsConfigWhether Helidon should expose meters related to virtual threads.- Specified by:
virtualThreadsEnabledin interfaceMetricsConfig- Returns:
- true to include meters related to virtual threads
-
virtualThreadsPinnedThreshold
Description copied from interface:MetricsConfigThreshold for sampling pinned virtual threads to include in the pinned threads meter.- Specified by:
virtualThreadsPinnedThresholdin interfaceMetricsConfig- Returns:
- threshold used to filter virtual thread pinning events
-
config
Description copied from interface:MetricsConfigMetrics configuration node.- Specified by:
configin interfaceMetricsConfig- Returns:
- metrics configuration
-
builtInMeterNameFormat
Description copied from interface:MetricsConfigOutput format for built-in meter names.BuiltInMeterNameFormat.SNAKEselects "snake_case" which does not conform to the MicroProfile Metrics specification.- Specified by:
builtInMeterNameFormatin interfaceMetricsConfig- Returns:
- the output format for built-in meter names
-
jsonUnitsDefault
Description copied from interface:MetricsConfigDefault 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.- Specified by:
jsonUnitsDefaultin interfaceMetricsConfig- Returns:
- default
TimeUnitto use for JSON timer output
-
warnOnMultipleRegistries
public boolean warnOnMultipleRegistries()Description copied from interface:MetricsConfigWhether 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.
- Specified by:
warnOnMultipleRegistriesin interfaceMetricsConfig- Returns:
- whether to log warnings upon creation of multiple meter registries
-
publishers
Description copied from interface:MetricsConfigMetrics publishers which make the metrics data available to external systems. Helidon's Micrometer-based metrics provider includes publishers with the config keysprometheus(inferred by default) andotlp. See the config reference entries forio.helidon.metrics.providers.micrometer.PrometheusPublisherandio.helidon.metrics.providers.micrometer.OtlpPublisher.- Specified by:
publishersin interfaceMetricsConfig- Returns:
- metrics publishers
-
toString
-
equals
-
hashCode
-