Add Command filter to MicrometerCommandLatencyRecorder
#2406
Labels
type: feature
A new feature
Milestone
Feature Request
Describe the solution you'd like
I would like to have the possibility of choosing which commands should be recorded when using
MicrometerCommandLatencyRecorder
. Using the latest version (6.2.4-RELEASE
), this is not possible and all commands issued to Redis are stored in MicrometerMeterRegistry
. I'm willing to submit a Pull request implementing this feature.Describe alternatives you've considered
I thought about implementing this by adding a
List<CommandType>
as a new member to theMicrometerOptions
class, and then, onMicrometerCommandLatencyRecorder#recordCommandLatency
method, add a second validation checking if theProtocolKeyword#name
is contained in the new list of commands option.Possible implementation would look like:
The name
desiredCommands
is up to debate, I'm not certain if the word "desired" fully expresses the feature proposalTeachability, Documentation, Adoption, Migration Strategy
Whenever someone would like to filter which commands should have their latency recorded, it would only need to build the
MicrometerOptions
with the new method, something like:Regarding documentation, my PullRequest would include a new row to the
MicrometerOptions
table description (https://github.com/lettuce-io/lettuce-core/wiki/Command-Latency-Metrics#micrometer-options)Any opinions about it would be appreciated!
The text was updated successfully, but these errors were encountered: