Interface MeterRegistryFormatterProvider
- All Known Implementing Classes:
JsonMeterRegistryFormatterProvider, MicrometerPrometheusFormatterProvider
public interface MeterRegistryFormatterProvider
Behavior for providers of meter registry formatters, which (if then can) furnish a formatter given a
MediaType.
We use a provider approach so code can obtain and run formatters that might depend heavily on particular implementations without the calling code having to share that heavy dependency.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<MeterRegistryFormatter> formatter(MediaType mediaType, MetricsConfig metricsConfig, MeterRegistry meterRegistry, Map<String, Collection<String>> tagSelections, Iterable<String> nameSelection) Returns, if possible, aMeterRegistryFormattercapable of preparing output according to the specifiedMediaTypeand selections.formatter(MediaType mediaType, MetricsConfig metricsConfig, MeterRegistry meterRegistry, Optional<String> scopeTagName, Iterable<String> scopeSelection, Iterable<String> nameSelection) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
formatter
default Optional<MeterRegistryFormatter> formatter(MediaType mediaType, MetricsConfig metricsConfig, MeterRegistry meterRegistry, Map<String, Collection<String>> tagSelections, Iterable<String> nameSelection) Returns, if possible, aMeterRegistryFormattercapable of preparing output according to the specifiedMediaTypeand selections.- Parameters:
mediaType- media type of the desired outputmetricsConfig-MetricsConfigto influence the formattingmeterRegistry-MeterRegistryfrom which to gather datatagSelections- tag names and accepted values to format; empty means no tag-based restrictionnameSelection- meter names to format; empty means no name-based restriction- Returns:
- compatible formatter; empty if none
- Since:
- 27.0.0
-
formatter
@Deprecated(forRemoval=true, since="27.0.0") Optional<MeterRegistryFormatter> formatter(MediaType mediaType, MetricsConfig metricsConfig, MeterRegistry meterRegistry, Optional<String> scopeTagName, Iterable<String> scopeSelection, Iterable<String> nameSelection) Deprecated, for removal: This API element is subject to removal in a future version.Useformatter(MediaType, MetricsConfig, MeterRegistry, Map, Iterable). Scope-specific arguments are ignored and this method will be removed.Returns a formatter, if possible, ignoring the scope-specific arguments.- Parameters:
mediaType- media type of the desired outputmetricsConfig-MetricsConfigto influence the formattingmeterRegistry-MeterRegistryfrom which to gather datascopeTagName- ignored; must not benullscopeSelection- ignored; must not benullnameSelection- meter names to format; empty means no name-based restriction- Returns:
- compatible formatter; empty if none
-
formatter(MediaType, MetricsConfig, MeterRegistry, Map, Iterable).