Filter out `command` tags from Lettuce metrics and prepend a "chat." prefix to Lettuce metric names
This commit is contained in:
parent
25f759dd07
commit
8bf5ee45ed
|
@ -63,6 +63,21 @@ public class MetricsUtil {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Remove high-cardinality `command` tags from Lettuce metrics and prepend "chat." to meter names
|
||||||
|
datadogMeterRegistry.config().meterFilter(new MeterFilter() {
|
||||||
|
@Override
|
||||||
|
public Meter.Id map(final Meter.Id id) {
|
||||||
|
if (id.getName().startsWith("lettuce")) {
|
||||||
|
return id.withName(PREFIX + "." + id.getName())
|
||||||
|
.replaceTags(id.getTags().stream()
|
||||||
|
.filter(tag -> !"command".equals(tag.getKey()))
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
return MeterFilter.super.map(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Metrics.addRegistry(datadogMeterRegistry);
|
Metrics.addRegistry(datadogMeterRegistry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue