-
Notifications
You must be signed in to change notification settings - Fork 877
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
Feature: Add redis search module metrics #953
Feature: Add redis search module metrics #953
Conversation
b6959b0
to
3f02f94
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #953 +/- ##
==========================================
+ Coverage 80.25% 80.35% +0.10%
==========================================
Files 17 18 +1
Lines 1980 2026 +46
==========================================
+ Hits 1589 1628 +39
- Misses 306 311 +5
- Partials 85 87 +2 ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 11101178781Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
402bacd
to
7c51e0c
Compare
7c51e0c
to
081482b
Compare
Sorry about the delay - looking at the PR now. |
No problem, thank you! |
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.
General approach looks good - just a couple of minor questions
exporter/exporter.go
Outdated
// Redis Modules metrics | ||
// RediSearch module | ||
"search_number_of_indexes": "search_number_of_indexes", | ||
"search_used_memory_indexes": "search_used_memory_indexes", |
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.
search_used_memory_indexes
I think this could use the unit this is in. Add _bytes
?
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.
Thanks, fixed
exporter/exporter.go
Outdated
"stream_radix_tree_nodes": {txt: `Radix tree nodes count`, lbls: []string{"db", "stream"}}, | ||
"up": {txt: "Information about the Redis instance"}, | ||
"module_info": {txt: "Information about loaded Redis module", lbls: []string{"name", "ver", "api", "filters", "usedby", "using"}}, | ||
"search_version": {txt: "Information about the RediSearch module", lbls: []string{"version"}}, |
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.
can we bake this into the module_info
metric? Add a version
label? seems tightly related to the module but I don't know if they keep different versions for the two.
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.
It's already exists there, just in different format. Here it's search_version:2.10.5
, but there it's module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors]
, i.e. ver=21005
In theory we can drop this metric and keep only module_info, but it looks nicer with dots as separators here.
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 added also now continue after registering metrics to avoid unneeded parsing of metrics after registerConstMetricGauge
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.
In theory we can drop this metric and keep only module_info, but it looks nicer with dots as separators here.
- in that case, if the versions match, then I'd prefer to just capture one metric - the formatting is just eye candy.
But if the module version could differ from the search engine version then it'd make sense to capture both.
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.
But if the module version could differ from the search engine version then it'd make sense to capture both.
Nope, that afaik shouldn't happen, removed search_version and let's keep version in module_info as is.
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.
👍
17b1ee1
to
d97d711
Compare
@@ -83,3 +83,8 @@ services: | |||
image: tile38/tile38:latest | |||
ports: | |||
- "19851:9851" | |||
|
|||
redis-stack: | |||
image: redis/redis-stack-server:7.4.0-v0 |
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.
For context, 7.4.0-v0
is current version of redis-stack-server
and it includes redis 7.4 + modules with recent versions.
exporter/exporter.go
Outdated
"stream_radix_tree_nodes": {txt: `Radix tree nodes count`, lbls: []string{"db", "stream"}}, | ||
"up": {txt: "Information about the Redis instance"}, | ||
"module_info": {txt: "Information about loaded Redis module", lbls: []string{"name", "ver", "api", "filters", "usedby", "using"}}, | ||
"search_version": {txt: "Information about the RediSearch module", lbls: []string{"version"}}, |
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.
In theory we can drop this metric and keep only module_info, but it looks nicer with dots as separators here.
- in that case, if the versions match, then I'd prefer to just capture one metric - the formatting is just eye candy.
But if the module version could differ from the search engine version then it'd make sense to capture both.
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.
Nice work, looks good!
Will merge later today or tomorrow and cut a new release.
Apologies for the delay - I was busy this past week. I'll get back to this in the next few days. |
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.
Nice work - thanks for your patience and for pushing this all the way to completion!
Thank you for review. |
Yeah, let me cut a release and get this out, sorry for the delay. |
// RediSearch module | ||
"search_number_of_indexes": "search_number_of_indexes", | ||
"search_used_memory_indexes": "search_used_memory_indexes_bytes", | ||
"search_total_indexing_time": "search_total_indexing_time_ms", |
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.
search_total_indexing_time
is apparently a counter, will prepare PR with renaming it to search_indexing_time_ms_total
Initially added in oliver006#953 as gauges, but usage shows that they're counters. Related: oliver006#942
fixes: #942
Found that redis returns all related information to modules with
info modules
and added collection of all metrics that looks useful so far.Parsing of
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
is not ideal, but works fine with current Redis 7.4 / Redis search module 2.10