Class MetricsConfig.BuilderBase.MetricsConfigImpl

java.lang.Object
io.helidon.metrics.api.MetricsConfig.BuilderBase.MetricsConfigImpl
All Implemented Interfaces:
Prototype.Api, MetricsConfig
Enclosing class:
MetricsConfig.BuilderBase<BUILDER extends MetricsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MetricsConfig>

protected static class MetricsConfig.BuilderBase.MetricsConfigImpl extends Object implements MetricsConfig
Generated implementation of the prototype, can be extended by descendant prototype implementations.
  • Field Details

    • METRICS_CONFIG_KEY

      static final String METRICS_CONFIG_KEY
      The config key containing settings for all of metrics.
      See Also:
    • SCOPE_CONFIG_KEY

      @Deprecated(forRemoval=true, since="27.0.0") static final String SCOPE_CONFIG_KEY
      Deprecated, for removal: This API element is subject to removal in a future version.
      Core metrics ignores scope configuration, and this constant will be removed.
      Legacy scope configuration key retained for compatibility.
      See Also:
    • KEY_PERFORMANCE_INDICATORS_CONFIG_KEY

      static final String KEY_PERFORMANCE_INDICATORS_CONFIG_KEY
      Config key for KPI metrics settings.
      See Also:
    • DEFAULT_JSON_UNITS_DEFAULT

      static final TimeUnit DEFAULT_JSON_UNITS_DEFAULT
      Default JSON unit.
  • Constructor Details

    • MetricsConfigImpl

      protected MetricsConfigImpl(MetricsConfig.BuilderBase<?,?> builder)
      Create an instance providing a builder.
      Parameters:
      builder - extending builder base of this prototype
  • Method Details

    • enabled

      public boolean enabled()
      Description copied from interface: MetricsConfig
      Whether metrics functionality is enabled.
      Specified by:
      enabled in interface MetricsConfig
      Returns:
      if metrics are configured to be enabled
    • permitAll

      public boolean permitAll()
      Description copied from interface: MetricsConfig
      Whether to allow anybody to access the metrics endpoint when this config is used by a metrics observer. This setting has no effect in the top-level metrics config which controls the shared registry.
      Specified by:
      permitAll in interface MetricsConfig
      Returns:
      whether to permit access to the observer's metrics endpoint to anybody, defaults to true
      See Also:
    • roles

      public List<String> roles()
      Description copied from interface: MetricsConfig
      Role names allowed to access the metrics endpoint when this config is used by a metrics observer and MetricsConfig.permitAll() is false. This setting has no effect in the top-level metrics config which controls the shared registry.
      Specified by:
      roles in interface MetricsConfig
      Returns:
      allowed role names
    • keyPerformanceIndicatorMetricsConfig

      public KeyPerformanceIndicatorMetricsConfig keyPerformanceIndicatorMetricsConfig()
      Description copied from interface: MetricsConfig
      Key performance indicator metrics settings.
      Specified by:
      keyPerformanceIndicatorMetricsConfig in interface MetricsConfig
      Returns:
      key performance indicator metrics settings
    • tags

      public List<Tag> tags()
      Description copied from interface: MetricsConfig
      Global tags.
      Specified by:
      tags in interface MetricsConfig
      Returns:
      name/value pairs for global tags
    • appName

      public Optional<String> appName()
      Description copied from interface: MetricsConfig
      Value for the application tag to be added to each meter ID.
      Specified by:
      appName in interface MetricsConfig
      Returns:
      application tag value
    • appTagName

      public Optional<String> appTagName()
      Description copied from interface: MetricsConfig
      Name for the application tag to be added to each meter ID.
      Specified by:
      appTagName in interface MetricsConfig
      Returns:
      application tag name
    • scoping

      @Deprecated(since="27.0.0", forRemoval=true) public ScopingConfig scoping()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: MetricsConfig
      Returns scope settings retained for compatibility; core metrics ignores them.
      Specified by:
      scoping in interface MetricsConfig
      Returns:
      configured scope settings
    • restRequestEnabled

      public boolean restRequestEnabled()
      Description copied from interface: MetricsConfig
      Whether automatic REST request metrics should be measured.
      Specified by:
      restRequestEnabled in interface MetricsConfig
      Returns:
      true/false
    • virtualThreadsEnabled

      public boolean virtualThreadsEnabled()
      Description copied from interface: MetricsConfig
      Whether Helidon should expose meters related to virtual threads.
      Specified by:
      virtualThreadsEnabled in interface MetricsConfig
      Returns:
      true to include meters related to virtual threads
    • virtualThreadsPinnedThreshold

      public Duration virtualThreadsPinnedThreshold()
      Description copied from interface: MetricsConfig
      Threshold for sampling pinned virtual threads to include in the pinned threads meter.
      Specified by:
      virtualThreadsPinnedThreshold in interface MetricsConfig
      Returns:
      threshold used to filter virtual thread pinning events
    • config

      public Config config()
      Description copied from interface: MetricsConfig
      Metrics configuration node.
      Specified by:
      config in interface MetricsConfig
      Returns:
      metrics configuration
    • builtInMeterNameFormat

      public BuiltInMeterNameFormat builtInMeterNameFormat()
      Description copied from interface: MetricsConfig
      Output format for built-in meter names.

      BuiltInMeterNameFormat.SNAKE selects "snake_case" which does not conform to the MicroProfile Metrics specification.

      Specified by:
      builtInMeterNameFormat in interface MetricsConfig
      Returns:
      the output format for built-in meter names
    • jsonUnitsDefault

      public Optional<TimeUnit> jsonUnitsDefault()
      Description copied from interface: MetricsConfig
      Default units for timer output in JSON if not specified on a given timer.

      If the configuration key is absent, the Helidon JSON output uses TimeUnit.SECONDS. If the configuration key is present, Helidon formats each timer using that timer's specific units (if set) and the config value otherwise.

      Specified by:
      jsonUnitsDefault in interface MetricsConfig
      Returns:
      default TimeUnit to use for JSON timer output
    • warnOnMultipleRegistries

      public boolean warnOnMultipleRegistries()
      Description copied from interface: MetricsConfig
      Whether to log warnings when multiple registries are created.

      By far most applications use a single meter registry, but certain app or library programming errors can cause Helidon to create more than one. By default, Helidon logs warning messages for each additional meter registry created. This setting allows users with apps that need multiple meter registries to suppress those warnings.

      Specified by:
      warnOnMultipleRegistries in interface MetricsConfig
      Returns:
      whether to log warnings upon creation of multiple meter registries
    • publishers

      public List<MetricsPublisher> publishers()
      Description copied from interface: MetricsConfig
      Metrics publishers which make the metrics data available to external systems. Helidon's Micrometer-based metrics provider includes publishers with the config keys prometheus (inferred by default) and otlp. See the config reference entries for io.helidon.metrics.providers.micrometer.PrometheusPublisher and io.helidon.metrics.providers.micrometer.OtlpPublisher.
      Specified by:
      publishers in interface MetricsConfig
      Returns:
      metrics publishers
    • toString

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object