MetricsOptions Class
- java.
lang. Object - com.
azure. core. util. MetricsOptions
- com.
public class MetricsOptions
Metrics configuration options for clients.
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
MetricsOptions() |
Creates new instance of MetricsOptions |
|
protected | MetricsOptions(Class<? extends MeterProvider> meterProvider) |
Creates new instance of MetricsOptions |
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Metrics |
fromConfiguration(Configuration configuration)
Attempts to load metrics options from the configuration. |
Class<> |
getMeterProvider()
Gets configured MeterProvider implementation that should be used to construct an instance of Meter. |
boolean |
isEnabled()
Flag indicating if metrics should be enabled. |
Metrics |
setEnabled(boolean enabled)
Enables or disables metrics. |
Methods inherited from java.lang.Object
Constructor Details
MetricsOptions
public MetricsOptions()
Creates new instance of MetricsOptions
MetricsOptions
protected MetricsOptions(Class extends MeterProvider> meterProvider)
Creates new instance of MetricsOptions
Parameters:
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:
null
is passed then getGlobalConfiguration() will be used.
Returns:
getMeterProvider
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:
true
to enable metrics.
Returns:
MetricsOptions
object.Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for