Package com.azure.core.util.metrics
Interface MeterProvider
public interface MeterProvider
Resolves and provides
Meter implementation.
This class is intended to be used by Azure client libraries and provides abstraction over different metrics implementations. Application developers should use metrics implementations such as OpenTelemetry or Micrometer directly.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MetercreateMeter(LibraryTelemetryOptions libraryOptions, MetricsOptions applicationOptions) Creates meter instance.createMeter(String libraryName, String libraryVersion, MetricsOptions applicationOptions) Creates named and versioned meter instance.static MeterProviderReturns default implementation ofMeterProviderthat uses SPI to resolve metrics implementation.
-
Method Details
-
createMeter
Creates named and versioned meter instance.MetricsOptions metricsOptions = new MetricsOptions(); Meter meter = MeterProvider.getDefaultProvider().createMeter("azure-core", "1.0.0", metricsOptions);- Parameters:
libraryName- Azure client library package namelibraryVersion- Azure client library versionapplicationOptions- instance ofMetricsOptionsprovided by the application.- Returns:
- a meter instance.
-
createMeter
default Meter createMeter(LibraryTelemetryOptions libraryOptions, MetricsOptions applicationOptions) Creates meter instance.- Parameters:
libraryOptions- Azure SDK telemetry options.applicationOptions- instance ofMetricsOptionsprovided by the application.- Returns:
- a meter instance.
-
getDefaultProvider
Returns default implementation ofMeterProviderthat uses SPI to resolve metrics implementation.- Returns:
- an instance of
MeterProvider
-