Interface AutoHttpMetricsConfig

All Superinterfaces:
Prototype.Api
All Known Implementing Classes:
AutoHttpMetricsConfig.BuilderBase.AutoHttpMetricsConfigImpl

public interface AutoHttpMetricsConfig extends Prototype.Api
Automatic metrics collection 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

      static AutoHttpMetricsConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      @Deprecated static AutoHttpMetricsConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static AutoHttpMetricsConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • isMeasured

      default boolean isMeasured(Method method, UriPath uriPath)
      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 enabled value 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 enabled set to true.

      Parameters:
      method - HTTP method from the request
      uriPath - URI path from the request
      Returns:
      whether the request should be measured, based on the configuration
    • isOptedIn

      default boolean isOptedIn(String meterName, String attributeName)
      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 for
      attributeName - 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

      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

      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