-
Notifications
You must be signed in to change notification settings - Fork 814
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
[Redis] Add slow log metrics #1400
Conversation
Superseed #1330 Creates a histogram per redis command (HGET, LPUSH, etc) that is in the slow query log.
|
||
command_tag = 'command:{0}'.format(slowlog['command'].split()[0]) | ||
value = slowlog['duration'] | ||
self.histogram('redis.slowlog.micros', value, tags=tags + [command_tag]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it makes sense to convert to something other than microseconds (like milliseconds or seconds) since we don't really use that for any other metrics? If not, we might want to spell out "microseconds" or something. Maybe just me but I didn't know what "micros" meant without looking at the docs for the redis slowlog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on second thought, a conversion might be a bad idea because it would make the axis all wonky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think micros
is good enough - or even in_micros
which us better, IMHO, than μs
which would likely become us
anyway. We have used micros for a long time with cassandra metrics too.
Cool metrics, interested to see what sort of data we can get from this on prod. Do you know if the commands in transactions will show up or will it just show up as |
if max_slow_entries > DEFAULT_MAX_SLOW_ENTRIES: | ||
self.warning("Redis {0} is higher than {1}. Defaulting to {1}."\ | ||
"If you need a higher value, please set {0} in your check config"\ | ||
.format(max_slow_entries, DEFAULT_MAX_SLOW_ENTRIES)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will result in having a string like
Redis 256 is higher than 128. Defaulting to 128. If you need a higher value please set 256 in your check config
Which is not super understandable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - the wording here should help the user understand what it is we're trying to tell them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arf i reused the same variable name, max_slow_entries was supposed to be "slowlog-max-len" good catch!
Yep @conorbranagan I think only individual commands go in the slow log, even if they're grouped in a transaction. |
|
||
# Max number of entries to fetch from the sloq query log | ||
# By default, the check wil read this value from the redis config | ||
# But if it's too high, it will default to 128 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"too high" should be spelled out, why is too high too high? "Higher than 128, due to potential increased latency to retrieve more than 128 slowlog entries every 15 seconds"...
Thanks for the comments, i took care of them 6f52aee |
Supersedes #1330
Creates a histogram per redis command (HGET, LPUSH, etc) that is in the
slow query log.