-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to filter out metrics #4599
Comments
One way to do this w/ the existing code is by subclassing an existing MeterRegistryFactory package mypackage;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.config.MeterFilter;
import org.apache.accumulo.core.spi.metrics.LoggingMeterRegistryFactory;
public class FilteringLoggingMRFactory extends LoggingMeterRegistryFactory {
@Override
public MeterRegistry create(final InitParameters params) {
var meterRegistry = super.create(params);
MeterFilter myFilter = MeterFilter.denyNameStartsWith("accumulo.gc");
meterRegistry.config().meterFilter(myFilter);
return meterRegistry;
}
} |
So, that's a fair point. We don't necessarily have to implement something to provide some base functionality. A user can extend one of our existing implementations or create their own to provide this functionality. |
Wondering if it would be useful to provide some kind of help in the SPI for building micrometer filters related to Accumulo metrics. One possible way to do this would be to have constants related to metrics in the SPI. This could enable writing a MeterRegistryFactory that manipulates Accumulo metrics using those constants. Could have something like the following. package org.apache.accumulo.core.spi.metrics;
class MetricsConstants {
static class Tags {
String INSTANCE_TAG = "instance.name";
}
static class Meters {
String COMPACTIONS_QUEUED = "...";
}
} With the above then could have a scenario like the following.
Completely unrelated to metrics, but if this approach of putting metrics related constants in the SPI works then it could also potentially work for Accumulo's properties. Could have constants related to those in the SPI maybe. |
I can take a look at this |
Is your feature request related to a problem? Please describe.
It's possible that a user may not need one or more metrics that we publish via Micrometer.
Describe the solution you'd like
I think we can add a method on MeterRegistryFactory, maybe even a default method, that accepts a comma separated list of regular expressions via a property value, that returns a
MeterFilter
viaMeterFilter.deny(Predicate)
. ThisMeterFilter
that is returned will need to be added to theMeterRegistry
usingMeterRegistry.meterFilter
.The text was updated successfully, but these errors were encountered: