You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A metric likegorm_query_duration_seconds_bucket which takes a label say query_name, now we can have a chain method on each query and specify this label
This metric collects the time taken for a query execution.
Motivation
I was looking at enabling prometheus metrics for my postgres DB, and wanted to capture how long each of my queries are taking to execute.
I can currently see that in postgres gorm logs print how long a query took to run, so i am guessing we have this information and that this can be emitted as a prometheus metric with user specified label.
So instead of measuring the duration myself and emitting prometheus metrics in the application, i thought gorm can do that easily by adding a chain method for this.
I don't have much idea about the architecture of code and so not sure if this would be simple change or something that does not fit well with the structure, but wanted to see if this is something that would be a good addition
Related Issues
NA
The text was updated successfully, but these errors were encountered:
Make sense, as I believe all the query calls Execute method at the end for finisher methods, also the spent duration is already tracked and part of GORM logger, however wondering how GORM can maintain the cardinality in the metrics 🤔
Describe the feature
A metric like
gorm_query_duration_seconds_bucket
which takes a label sayquery_name
, now we can have a chain method on each query and specify this labelThis metric collects the time taken for a query execution.
Motivation
I was looking at enabling prometheus metrics for my postgres DB, and wanted to capture how long each of my queries are taking to execute.
I can currently see that in postgres gorm logs print how long a query took to run, so i am guessing we have this information and that this can be emitted as a prometheus metric with user specified label.
So instead of measuring the duration myself and emitting prometheus metrics in the application, i thought gorm can do that easily by adding a chain method for this.
I don't have much idea about the architecture of code and so not sure if this would be simple change or something that does not fit well with the structure, but wanted to see if this is something that would be a good addition
Related Issues
NA
The text was updated successfully, but these errors were encountered: