-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 redis key metricset #9657
Add redis key metricset #9657
Conversation
d400021
to
a6ce610
Compare
a6ce610
to
39aebc0
Compare
jenkins, test this |
jenkins test this please |
IdleTimeout time.Duration `config:"idle_timeout"` | ||
Network string `config:"network"` | ||
MaxConn int `config:"maxconn" validate:"min=1"` | ||
Password string `config:"password"` |
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.
Config and pool initialization can be probably reused in other metricsets, to be fixed in a follow up.
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.
Issue created for follow ups #9678
// Close connections | ||
func (m *MetricSet) Close() error { | ||
return m.pool.Close() | ||
} |
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 this needs to be added in other metricsets too, to be added in the follow-up PR.
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 looks great. Left a few minor comments.
metricbeat/module/redis/redis.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
if keyType == "none" { |
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.
We could make this a constant.
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.
Umm, also for the rest of types? Maybe the redis library already has constants, I'll take a look.
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.
Using constants for types names now.
return nil, err | ||
} | ||
|
||
info := map[string]interface{}{ |
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.
Why not use common.MapStr 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.
This file was not using MapStr
or even common
at the moment, I didn't want to add it now, I don't see it will bring anything here.
Co-Authored-By: jsoriano <jaime.soriano@elastic.co>
fbc047a
to
9621ba2
Compare
@@ -29,6 +29,15 @@ import ( | |||
rd "github.com/garyburd/redigo/redis" | |||
) | |||
|
|||
const ( | |||
TypeNone = "none" |
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.
exported const TypeNone should have comment (or a comment on this block) or be unexported
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.
We can decide about removing beta later. Failures do not seem to be related.
[[metricbeat-metricset-redis-key]] | ||
=== Redis key metricset | ||
|
||
beta[] |
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.
Should we go GA with this directly?
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.
Ok, let's go for GA, I forgot to add the beta warning in the metricset in any case 😄
I will add a dashboard for keys in a follow-up PR. |
Add redis key metricset to collect information about keys like length, type or TTL. (cherry picked from commit 5dbe803)
Add redis key metricset to collect information about keys like length, type or TTL. (cherry picked from commit 5dbe803) Add a dashboard with details for Redis keys using the new key metricset. Visualizations included show lists length, what is useful when redis is used for queuing, and average strings sizes and TTLs, what is useful when Redis is used as a cache. (cherry picked from commit ac04c32)
Add redis key metricset to collect information about keys like length, type or TTL.
Fix #9582