Package io.micrometer.core.instrument
Class MeterRegistry.Config
java.lang.Object
io.micrometer.core.instrument.MeterRegistry.Config
- Enclosing class:
MeterRegistry
Access to configuration options for this registry.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclock()
commonTags
(Iterable<Tag> tags) Append a list of common tags to apply to all metrics reported to the monitoring system.commonTags
(String... tags) Append a list of common tags to apply to all metrics reported to the monitoring system.Returns the currentHighCardinalityTagsDetector
.meterFilter
(MeterFilter filter) Add a meter filter to the registry.namingConvention
(NamingConvention convention) Use the provided naming convention, overriding the default for your monitoring system.onMeterAdded
(Consumer<Meter> meterAddedListener) Register an event listener for each meter added to the registry.onMeterRegistrationFailed
(BiConsumer<Meter.Id, String> meterRegistrationFailedListener) Register an event listener for meter registration failures.onMeterRemoved
(Consumer<Meter> meterRemovedListener) Register an event listener for each meter removed from the registry.pauseDetector
(PauseDetector detector) Sets the default pause detector to use for all timers in this registry.Creates and starts a newHighCardinalityTagsDetector
for this registry.withHighCardinalityTagsDetector
(long threshold, Duration delay) Creates and starts a newHighCardinalityTagsDetector
for this registry.
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
commonTags
Append a list of common tags to apply to all metrics reported to the monitoring system.- Parameters:
tags
- Tags to add to every metric.- Returns:
- This configuration instance.
-
commonTags
Append a list of common tags to apply to all metrics reported to the monitoring system. Must be an even number of arguments representing key/value pairs of tags.- Parameters:
tags
- MUST be an even number of arguments representing key/value pairs of tags.- Returns:
- This configuration instance.
-
meterFilter
Add a meter filter to the registry. Filters are applied in the order in which they are added.- Parameters:
filter
- The filter to add to the registry.- Returns:
- This configuration instance.
-
onMeterAdded
Register an event listener for each meter added to the registry.- Parameters:
meterAddedListener
- a meter-added event listener to be added- Returns:
- This configuration instance.
-
onMeterRemoved
@Incubating(since="1.1.0") public MeterRegistry.Config onMeterRemoved(Consumer<Meter> meterRemovedListener) Register an event listener for each meter removed from the registry.- Parameters:
meterRemovedListener
- a meter-removed event listener to be added- Returns:
- This configuration instance.
- Since:
- 1.1.0
-
onMeterRegistrationFailed
@Incubating(since="1.6.0") public MeterRegistry.Config onMeterRegistrationFailed(BiConsumer<Meter.Id, String> meterRegistrationFailedListener) Register an event listener for meter registration failures.- Parameters:
meterRegistrationFailedListener
- An event listener for meter registration failures- Returns:
- This configuration instance
- Since:
- 1.6.0
-
namingConvention
Use the provided naming convention, overriding the default for your monitoring system.- Parameters:
convention
- The naming convention to use.- Returns:
- This configuration instance.
-
namingConvention
- Returns:
- The naming convention currently in use on this registry.
-
clock
- Returns:
- The clock used to measure durations of timers and long task timers (and sometimes influences publishing behavior).
-
pauseDetector
Sets the default pause detector to use for all timers in this registry.- Parameters:
detector
- The pause detector to use.- Returns:
- This configuration instance.
- See Also:
-
pauseDetector
- Returns:
- The pause detector that is currently in effect.
-
withHighCardinalityTagsDetector
Creates and starts a newHighCardinalityTagsDetector
for this registry.- Returns:
- This configuration instance.
- Since:
- 1.10.0
-
withHighCardinalityTagsDetector
Creates and starts a newHighCardinalityTagsDetector
for this registry.- Parameters:
threshold
- The threshold to use to detect high cardinality tags (if the number of Meters with the same name is higher than this value, that's a high cardinality tag).delay
- The delay between the termination of one check and the commencement of the next.- Returns:
- This configuration instance.
- Since:
- 1.10.0
-
highCardinalityTagsDetector
Returns the currentHighCardinalityTagsDetector
. You can "deregister" it by callingHighCardinalityTagsDetector.close()
or register a new one by closing the previous one and creating a new one.- Returns:
- The
HighCardinalityTagsDetector
that is currently in effect. - Since:
- 1.10.0
-