- Metric Sources
- Using Instrumental
- Where to Start
Metrician can automatically report metrics about an application's database queries made via Active Record. This allows you to track database speed and query load.
Metrician requires 2 configuration options be set in your copy of
metrician.yaml to report database metrics. Database metrics are enabled by default. For each query, Metrician can be configured to report the table name and query type (
INSERT, etc.). The following are the default settings.
:database: :enabled: true :query: :enabled: true :command: :enabled: false :table: :enabled: false :command_and_table: :enabled: false
||average query execution time (ms)|
||avg. query execution time (ms), including command issued|
||avg. query execution time (ms), including table against which query was executed|
||avg. query execution time (ms), including command issued and table against which query was executed|
Add the following expression to a graph to measure your database query rate (QPM, CPM, QPH, etc.):
Add the following expression to a graph (if you have command reporting enabled) to measure your read-write ratio:
gauge_count(app.database.query.select) / (gauge_count(app.database.query.insert) + gauge_count(app.database.query.update) + gauge_count(app.database.query.delete))