-
Notifications
You must be signed in to change notification settings - Fork 327
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
added db stat metrics #1176
added db stat metrics #1176
Conversation
Fixes kumahq#1068 Signed-off-by: Tharun <rajendrantharun@live.com>
4f2ba95
to
6cc9665
Compare
2bc0b5d
to
461aa37
Compare
added method BulkRegister in metrics Interface fixed integration test Signed-off-by: Tharun <rajendrantharun@live.com>
461aa37
to
094c57f
Compare
@@ -267,3 +274,94 @@ func (r *resourceMetaObject) GetCreationTime() time.Time { | |||
func (r *resourceMetaObject) GetModificationTime() time.Time { | |||
return r.ModificationTime | |||
} | |||
|
|||
func registerAndCollectMetrics(metrics core_metrics.Metrics, dbStats sql.DBStats) error { |
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.
Again - you are only collecting the initial metrics about the DB. You need to do db.Stats()
inside the closures.
Also change the name for registerMetrics
db, err := common_postgres.ConnectToDb(config) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if err := registerAndCollectMetrics(metrics, db.Stats()); err != nil { | ||
return nil, err |
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.
add context to the error - could not register DB metrics
Signed-off-by: Tharun <rajendrantharun@live.com>
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.
awesome, thanks!
Signed-off-by: Tharun rajendrantharun@live.com
Summary
Db Stat Metrics
Full changelog
Issues resolved
Fix #1068
Documentation