Package com.azure.core.util
Class MetricsOptions
java.lang.Object
com.azure.core.util.MetricsOptions
- Direct Known Subclasses:
OpenTelemetryMetricsOptions
Metrics configuration options for clients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MetricsOptions
fromConfiguration
(Configuration configuration) Attempts to load metrics options from the configuration.boolean
Flag indicating if metrics should be enabled.setEnabled
(boolean enabled) Enables or disables metrics.
-
Constructor Details
-
MetricsOptions
public MetricsOptions()Creates new instance ofMetricsOptions
-
-
Method Details
-
fromConfiguration
Attempts to load metrics options from the configuration.null
will be returned if no metric options are found in the environment.- Parameters:
configuration
- TheConfiguration
that is used to load proxy configurations from the environment. Ifnull
is passed thenConfiguration.getGlobalConfiguration()
will be used.- Returns:
- A
ProxyOptions
reflecting a proxy loaded from the environment, if no proxy is foundnull
will be returned.
-
isEnabled
public boolean isEnabled()Flag indicating if metrics should be enabled.- Returns:
true
if metrics are enabled,false
otherwise.
-
setEnabled
Enables or disables metrics. By default, metrics are enabled if and only if metrics implementation is detected.- Parameters:
enabled
- passtrue
to enable metrics.- Returns:
- the updated
MetricsOptions
object.
-