Interface AutoHttpMetricsConfig
- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
AutoHttpMetricsConfig.BuilderBase.AutoHttpMetricsConfigImpl
Automatic metrics collection settings.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forAutoHttpMetricsConfig.static classAutoHttpMetricsConfig.BuilderBase<BUILDER extends AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends AutoHttpMetricsConfig> Fluent API builder base forAutoHttpMetricsConfig. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a new fluent API builder to customize configuration.builder(AutoHttpMetricsConfig instance) Create a new fluent API builder from an existing instance.static AutoHttpMetricsConfigcreate()Create a new instance with default values.static AutoHttpMetricsConfigDeprecated.static AutoHttpMetricsConfigCreate a new instance from configuration.booleanenabled()Whether automatic metrics collection as a whole is enabled.default booleanisMeasured(Method method, UriPath uriPath) Decides whether the specified HTTP method and path should be measured.default booleanReturns whether the configuration indicates if the user has opted to have specified attribute (tag) added to meters for the specified meter name.optIn()Elective attribute for which to opt in.paths()Automatic metrics collection settings.sockets()Socket names for sockets to be instrumented with automatic metrics.
-
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
Deprecated.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
-
isMeasured
Decides whether the specified HTTP method and path should be measured.Given a request, we search for a path config that matches the request's path and HTTP method. We immediately return the
enabledvalue for the first path config that the request matches.If we find no match, we return true.
Helidon automatically prefixes the explicitly-configured path entries with implicit entries for Helidon-provided endpoints with measurement disabled. Users can enable automatic metrics for such an endpoint by adding explicit configuration for it with
enabledset totrue.- Parameters:
method- HTTP method from the requesturiPath- URI path from the request- Returns:
- whether the request should be measured, based on the configuration
-
isOptedIn
Returns whether the configuration indicates if the user has opted to have specified attribute (tag) added to meters for the specified meter name. Telemetry implementations can permit users to configure whether certain attributes--typically ones that might be expensive to obtain--are to set on automatic meters.- Parameters:
meterName- name of the meter to check forattributeName- name of the attribute to opt in- Returns:
- true if the attribute should be added to the meter; false otherwise
-
enabled
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
List<AutoHttpMetricsPathConfig> 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
-
create(io.helidon.config.Config)