public interface MeterFilter
MeterRegistry
to create new metrics, allow for filtering out
the metric altogether, transforming its ID (name or tags) in some way, and transforming its
configuration.
All new metrics should pass through each MeterFilter
in the order in which they were added.Modifier and Type | Method and Description |
---|---|
default MeterFilterReply |
accept(Meter.Id id) |
static MeterFilter |
accept(java.util.function.Predicate<Meter.Id> iff) |
static MeterFilter |
commonTags(java.lang.Iterable<Tag> tags) |
default HistogramConfig |
configure(Meter.Id id,
HistogramConfig config)
This is only called when filtering new timers and distribution summaries (i.e.
|
static MeterFilter |
deny(java.util.function.Predicate<Meter.Id> iff) |
static MeterFilter |
denyNameStartsWith(java.lang.String prefix) |
static MeterFilter |
ignoreTags(java.lang.String... tagKeys) |
default Meter.Id |
map(Meter.Id id) |
static MeterFilter |
maximumAllowableMetrics(int maximumTimeSeries)
Useful for cost-control in monitoring systems which charge directly or indirectly by the
total number of time series you generate.
|
static MeterFilter |
replaceTagValues(java.lang.String tagKey,
java.util.function.Function<java.lang.String,java.lang.String> replacement,
java.lang.String... exceptions) |
default MeterFilterReply accept(Meter.Id id)
id
- Id with map(io.micrometer.core.instrument.Meter.Id)
transformations applied.default HistogramConfig configure(Meter.Id id, HistogramConfig config)
HistogramConfig
).id
- Id with map(io.micrometer.core.instrument.Meter.Id)
transformations applied.config
- A histogram configuration guaranteed to be non-null.static MeterFilter commonTags(java.lang.Iterable<Tag> tags)
static MeterFilter ignoreTags(java.lang.String... tagKeys)
static MeterFilter replaceTagValues(java.lang.String tagKey, java.util.function.Function<java.lang.String,java.lang.String> replacement, java.lang.String... exceptions)
tagKey
- The tag key for which replacements should be madereplacement
- The value to replace withexceptions
- All a matching tag with this value to retain its original valuestatic MeterFilter accept(java.util.function.Predicate<Meter.Id> iff)
static MeterFilter deny(java.util.function.Predicate<Meter.Id> iff)
static MeterFilter maximumAllowableMetrics(int maximumTimeSeries)
maximumTimeSeries
- The total number of unique name/tag permutations allowed before filtering kicks in.static MeterFilter denyNameStartsWith(java.lang.String prefix)