Class MetricsOptions

java.lang.Object
com.azure.core.util.MetricsOptions
Direct Known Subclasses:
OpenTelemetryMetricsOptions

public class MetricsOptions extends Object
Metrics configuration options for clients.
  • Constructor Details

    • MetricsOptions

      public MetricsOptions()
      Creates new instance of MetricsOptions
  • Method Details

    • fromConfiguration

      public static MetricsOptions fromConfiguration(Configuration configuration)
      Attempts to load metrics options from the configuration. null will be returned if no metric options are found in the environment.
      Parameters:
      configuration - The Configuration that is used to load proxy configurations from the environment. If null is passed then Configuration.getGlobalConfiguration() will be used.
      Returns:
      A ProxyOptions reflecting a proxy loaded from the environment, if no proxy is found null will be returned.
    • isEnabled

      public boolean isEnabled()
      Flag indicating if metrics should be enabled.
      Returns:
      true if metrics are enabled, false otherwise.
    • setEnabled

      public MetricsOptions setEnabled(boolean enabled)
      Enables or disables metrics. By default, metrics are enabled if and only if metrics implementation is detected.
      Parameters:
      enabled - pass true to enable metrics.
      Returns:
      the updated MetricsOptions object.