Class AutoHttpMetricsConfig.BuilderBase<BUILDER extends AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AutoHttpMetricsConfig>

java.lang.Object
io.helidon.webserver.observe.metrics.AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.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

public abstract static class AutoHttpMetricsConfig.BuilderBase<BUILDER extends AutoHttpMetricsConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AutoHttpMetricsConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for AutoHttpMetricsConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(AutoHttpMetricsConfig prototype)
      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

      public BUILDER from(AutoHttpMetricsConfig.BuilderBase<?,?> builder)
      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 public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.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

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.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

      public BUILDER enabled(boolean enabled)
      Whether automatic metrics collection as a whole is enabled.
      Parameters:
      enabled - automatic metrics collection enabled
      Returns:
      updated builder instance
      See Also:
    • clearSockets

      public BUILDER clearSockets()
      Clear all sockets.
      Returns:
      updated builder instance
      See Also:
    • sockets

      public BUILDER sockets(Set<String> 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

      public BUILDER addSockets(Set<String> 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:
    • clearPaths

      public BUILDER clearPaths()
      Clear all paths.
      Returns:
      updated builder instance
      See Also:
    • paths

      public BUILDER paths(List<? extends 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 under paths in 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

      public BUILDER addPaths(List<? extends 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 under paths in 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

      public BUILDER addPath(AutoHttpMetricsPathConfig path)
      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 under paths in 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 under paths in 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

      public BUILDER clearOptIn()
      Clear all optIn.
      Returns:
      updated builder instance
      See Also:
    • optIn

      public BUILDER optIn(List<String> optIn)
      Elective attribute for which to opt in. Each string in the list is of the form meter-name:attribute-name where meter-name is the name of the meter and attribute-name is 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

      public BUILDER addOptIn(List<String> optIn)
      Elective attribute for which to opt in. Each string in the list is of the form meter-name:attribute-name where meter-name is the name of the meter and attribute-name is 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:
    • useUpdatedHttpMetrics

      public BUILDER useUpdatedHttpMetrics(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. The default retains the prior Helidon 4.x metric output.

      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

      public Set<String> 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 under paths in 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

      public List<String> optIn()
      Elective attribute for which to opt in. Each string in the list is of the form meter-name:attribute-name where meter-name is the name of the meter and attribute-name is the name of an attribute (tag) which is optional on that meter.
      Returns:
      opt-in attributes to be provided
    • 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. The default retains the prior Helidon 4.x metric output.

      Returns:
      whether to use the updated automatic HTTP metrics behavior
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance