- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
MetricsConfig.BuilderBase.MetricsConfigImpl
Configuration settings for metrics.
Scope handling configuration
Helidon allows developers to associate a scope with each meter. The "scoping" subsection of the "metrics" configuration controls- the default scope value to use if a meter is registered without an explicit scope setting, and
- whether and how Helidon records each meter's scope as a tag in the underlying implementation meter registry.
Specifically, users can specify whether scope tags are used at all and, if so, what tag name to use.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent API builder forMetricsConfig
.static class
MetricsConfig.BuilderBase<BUILDER extends MetricsConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends MetricsConfig> Fluent API builder base forMetricsConfig
. -
Field Summary
-
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.static MetricsConfig.Builder
builder()
Create a new fluent API builder to customize configuration.static MetricsConfig.Builder
builder
(MetricsConfig instance) Create a new fluent API builder from an existing instance.Output format for built-in meter names.config()
Metrics configuration node.static MetricsConfig
create()
Create a new instance with default values.static MetricsConfig
Create a new instance from configuration.boolean
enabled()
Whether metrics functionality is enabled.Deprecated, for removal: This API element is subject to removal in a future version.Provided for backward compatibility only; no replacementboolean
isMeterEnabled
(String name, String targetScope) Reports whether the specified meter within the indicated scope is enabled, according to the metrics configuration.boolean
isScopeEnabled
(String scope) Reports whether the specified scope is enabled, according to any scope configuration that is part of this metrics configuration.Key performance indicator metrics settings.lookupConfig
(String key) Looks up a single config value within the metrics configuration by config key.boolean
Whether to allow anybody to access the endpoint.boolean
Whether automatic REST request metrics should be measured.roles()
Hints for role names the user is expected to be in.scoping()
Settings related to scoping management.tags()
Global tags.
-
Field Details
-
METRICS_CONFIG_KEY
The config key containing settings for all of metrics.- See Also:
-
SCOPE_CONFIG_KEY
Config key for scope-related settings.- See Also:
-
KEY_PERFORMANCE_INDICATORS_CONFIG_KEY
Config key for KPI metrics settings.- See Also:
-
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
lookupConfig
Looks up a single config value within the metrics configuration by config key.- Parameters:
key
- config key to fetch- Returns:
- config value
-
isScopeEnabled
Reports whether the specified scope is enabled, according to any scope configuration that is part of this metrics configuration.- Parameters:
scope
- scope name- Returns:
- true if the scope as a whole is enabled; false otherwise
-
isMeterEnabled
Reports whether the specified meter within the indicated scope is enabled, according to the metrics configuration.- Parameters:
name
- meter nametargetScope
- scope within which to check- Returns:
- whether the meter is enabled
-
enabled
boolean enabled()Whether metrics functionality is enabled.- Returns:
- if metrics are configured to be enabled
-
permitAll
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
KeyPerformanceIndicatorMetricsConfig 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
ScopingConfig scoping()Settings related to scoping management.- Returns:
- scoping settings
-
restRequestEnabled
boolean restRequestEnabled()Whether automatic REST request metrics should be measured.- Returns:
- true/false
-
config
Config 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.time
meter should be registered as a gauge (vs. a counter). Thegc.time
meter 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
BuiltInMeterNameFormat builtInMeterNameFormat()Output format for built-in meter names.BuiltInMeterNameFormat.SNAKE
selects "snake_case" which does not conform to the MicroProfile Metrics specification.- Returns:
- the output format for built-in meter names
-