Class AutoHttpMetricsConfig.BuilderBase<BUILDER extends AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AutoHttpMetricsConfig>
- 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:
AutoHttpMetricsConfig.Builder
- Enclosing interface:
AutoHttpMetricsConfig
AutoHttpMetricsConfig.-
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 TypeMethodDescriptionaddKnownMethod(String knownMethod) HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.addKnownMethods(List<String> knownMethods) HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.Elective attribute for which to opt in.Automatic metrics collection settings.addPath(Consumer<AutoHttpMetricsPathConfig.Builder> consumer) Automatic metrics collection settings.addPaths(List<? extends AutoHttpMetricsPathConfig> paths) Automatic metrics collection settings.addSockets(Set<String> sockets) Socket names for sockets to be instrumented with automatic metrics.Clear all knownMethods.Clear all optIn.Clear all paths.Clear all sockets.config()Configuration used to configure this instance.Deprecated.Update builder from configuration (node of this type).booleanenabled()Whether automatic metrics collection as a whole is enabled.enabled(boolean enabled) Whether automatic metrics collection as a whole is enabled.from(AutoHttpMetricsConfig prototype) Update this builder from an existing prototype instance.from(AutoHttpMetricsConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.knownMethods(List<String> knownMethods) HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.optIn()Elective attribute for which to opt in.Elective attribute for which to opt in.paths()Automatic metrics collection settings.paths(List<? extends AutoHttpMetricsPathConfig> paths) Automatic metrics collection settings.protected voidHandles providers and decorators.sockets()Socket names for sockets to be instrumented with automatic metrics.Socket names for sockets to be instrumented with automatic metrics.toString()booleanWhether to use the updated automatic HTTP metrics behavior.useUpdatedHttpMetrics(boolean useUpdatedHttpMetrics) Whether to use the updated automatic HTTP metrics behavior.protected voidValidates required properties.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 AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends AutoHttpMetricsConfig> - 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 AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends AutoHttpMetricsConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
enabled
Whether automatic metrics collection as a whole is enabled.- Parameters:
enabled- automatic metrics collection enabled- Returns:
- updated builder instance
- See Also:
-
clearSockets
Clear all sockets.- Returns:
- updated builder instance
- See Also:
-
sockets
Socket names for sockets to be instrumented with automatic metrics. Defaults to all sockets.- Parameters:
sockets- socket names- Returns:
- updated builder instance
- See Also:
-
addSockets
Socket names for sockets to be instrumented with automatic metrics. Defaults to all sockets.- Parameters:
sockets- socket names- Returns:
- updated builder instance
- See Also:
-
clearPaths
Clear all paths.- Returns:
- updated builder instance
- See Also:
-
paths
Automatic metrics collection settings. Default excludes built-in Helidon paths (e.g., metrics, health). A request's path and HTTP method are checked against each entry underpathsin order.- If a request matches no entry, then the request is measured.
- If a request matches multiple entries, then the first match wins.
- Parameters:
paths- automatic metrics collection settings- Returns:
- updated builder instance
- See Also:
-
addPaths
Automatic metrics collection settings. Default excludes built-in Helidon paths (e.g., metrics, health). A request's path and HTTP method are checked against each entry underpathsin order.- If a request matches no entry, then the request is measured.
- If a request matches multiple entries, then the first match wins.
- Parameters:
paths- automatic metrics collection settings- Returns:
- updated builder instance
- See Also:
-
addPath
Automatic metrics collection settings. Default excludes built-in Helidon paths (e.g., metrics, health). A request's path and HTTP method are checked against each entry underpathsin order.- If a request matches no entry, then the request is measured.
- If a request matches multiple entries, then the first match wins.
- Parameters:
path- add single automatic metrics collection settings- Returns:
- updated builder instance
- See Also:
-
addPath
Automatic metrics collection settings. Default excludes built-in Helidon paths (e.g., metrics, health). A request's path and HTTP method are checked against each entry underpathsin order.- If a request matches no entry, then the request is measured.
- If a request matches multiple entries, then the first match wins.
- Parameters:
consumer- consumer of builder for automatic metrics collection settings- Returns:
- updated builder instance
- See Also:
-
clearOptIn
Clear all optIn.- Returns:
- updated builder instance
- See Also:
-
optIn
Elective attribute for which to opt in. Each string in the list is of the formmeter-name:attribute-namewheremeter-nameis the name of the meter andattribute-nameis the name of an attribute (tag) which is optional on that meter.- Parameters:
optIn- opt-in attributes to be provided- Returns:
- updated builder instance
- See Also:
-
addOptIn
Elective attribute for which to opt in. Each string in the list is of the formmeter-name:attribute-namewheremeter-nameis the name of the meter andattribute-nameis the name of an attribute (tag) which is optional on that meter.- Parameters:
optIn- opt-in attributes to be provided- Returns:
- updated builder instance
- See Also:
-
clearKnownMethods
Clear all knownMethods.- Returns:
- updated builder instance
- See Also:
-
knownMethods
HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.Default known HTTP methods:
CONNECT,DELETE,GET,HEAD,LIST,OPTIONS,PATCH,POST,PUT, andTRACE). Unlisted methods are reported as_OTHER, so configurations that add additional method names must also include default methods they intend to retain.Method names are canonicalized using Helidon's HTTP method model.
- Parameters:
knownMethods- known HTTP methods- Returns:
- updated builder instance
- See Also:
-
addKnownMethods
HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.Default known HTTP methods:
CONNECT,DELETE,GET,HEAD,LIST,OPTIONS,PATCH,POST,PUT, andTRACE). Unlisted methods are reported as_OTHER, so configurations that add additional method names must also include default methods they intend to retain.Method names are canonicalized using Helidon's HTTP method model.
- Parameters:
knownMethods- known HTTP methods- Returns:
- updated builder instance
- See Also:
-
addKnownMethod
HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.Default known HTTP methods:
CONNECT,DELETE,GET,HEAD,LIST,OPTIONS,PATCH,POST,PUT, andTRACE). Unlisted methods are reported as_OTHER, so configurations that add additional method names must also include default methods they intend to retain.Method names are canonicalized using Helidon's HTTP method model.
- Parameters:
knownMethod- add single known HTTP methods- Returns:
- updated builder instance
- See Also:
-
useUpdatedHttpMetrics
Whether to use the updated automatic HTTP metrics behavior.When enabled, OpenTelemetry automatic HTTP metrics are recorded when the response is sent, use seconds for the duration value, retain the response status when request processing throws an exception, and use the framework- provided route when one is available. HTTP method normalization using
known-methodsapplies in both updated and legacy metric modes.- Parameters:
useUpdatedHttpMetrics- whether to use the updated automatic HTTP metrics behavior- Returns:
- updated builder instance
- See Also:
-
enabled
public boolean enabled()Whether automatic metrics collection as a whole is enabled.- Returns:
- automatic metrics collection enabled
-
sockets
Socket names for sockets to be instrumented with automatic metrics. Defaults to all sockets.- Returns:
- socket names
-
paths
Automatic metrics collection settings. Default excludes built-in Helidon paths (e.g., metrics, health). A request's path and HTTP method are checked against each entry underpathsin order.- If a request matches no entry, then the request is measured.
- If a request matches multiple entries, then the first match wins.
- Returns:
- automatic metrics collection settings
-
optIn
Elective attribute for which to opt in. Each string in the list is of the formmeter-name:attribute-namewheremeter-nameis the name of the meter andattribute-nameis the name of an attribute (tag) which is optional on that meter.- Returns:
- opt-in attributes to be provided
-
knownMethods
HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods plusLIST; assigning this value fully replaces the set of method names.Default known HTTP methods:
CONNECT,DELETE,GET,HEAD,LIST,OPTIONS,PATCH,POST,PUT, andTRACE). Unlisted methods are reported as_OTHER, so configurations that add additional method names must also include default methods they intend to retain.Method names are canonicalized using Helidon's HTTP method model.
- Returns:
- known HTTP methods
-
useUpdatedHttpMetrics
public boolean useUpdatedHttpMetrics()Whether to use the updated automatic HTTP metrics behavior.When enabled, OpenTelemetry automatic HTTP metrics are recorded when the response is sent, use seconds for the duration value, retain the response status when request processing throws an exception, and use the framework- provided route when one is available. HTTP method normalization using
known-methodsapplies in both updated and legacy metric modes.- Returns:
- whether to use the updated automatic HTTP metrics behavior
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
Configuration used to configure this instance.- Returns:
- config instance
-
config(io.helidon.config.Config)