Interface AutoHttpMetricsConfig
- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
AutoHttpMetricsConfig.BuilderBase.AutoHttpMetricsConfigImpl
- 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 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.Exact, case-sensitive HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods; assigning this value fully replaces the set of method names.optIn()Elective attribute for which to opt in.paths()Automatic metrics collection settings.sockets()Socket names for sockets to be instrumented with automatic metrics.default booleanDeprecated.This option is ignored and will be removed in a future release.
-
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
-
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
-
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
-
knownMethods
Exact, case-sensitive HTTP methods to be used in the HTTP method tag for automatic metrics, defaulted to the standard HTTP methods; assigning this value fully replaces the set of method names.Default known HTTP methods:
CONNECT,DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,QUERY, 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 matched exactly. See the OpenTelemetry semantic convention for HTTP request methods.
- Returns:
- known HTTP methods
-
useUpdatedHttpMetrics
Deprecated.This option is ignored and will be removed in a future release.Retained for configuration compatibility with Helidon 4.x; Helidon 27 ignores the value and always uses the updated automatic HTTP metrics behavior.- Returns:
- configured value, which does not affect automatic HTTP metrics behavior
-