Micrometer: JDBC Metrics

Created on 1 Jun 2018  路  12Comments  路  Source: micrometer-metrics/micrometer

Having metrics about database is very important. JDBC level metrics would be very nice like:

The total number of database reads
The total number of database writes
Number of reads per second (per minute, 5 minutes & 15 minutes)
Number of writes per second (per minute, 5 minutes & 15 minutes)
Average/median/percentile query times for reads & for writes
help wanted spring-boot change

All 12 comments

Here is a sample project:
https://github.com/soulgalore/jdbcmetrics

This one seems also very usabe

https://github.com/gquintana/metrics-sql

I like the layered approach of metrics-sql (apply at either driver, connection, or datasource level).

@ohr this is fantastic. Thanks for sharing.

I have a demo that uses a forked version of the metrics-sql library mentioned above to get metrics in micrometer format.
https://github.com/pjfanning/slick-micrometer

I haven't modified the metrics to use micrometer tags yet.

@cemo https://spring.io/blog/2018/03/16/micrometer-spring-boot-2-s-new-application-metrics-collector - hikaricp has support for gathering micrometer metrics

@pjfanning It is metrics for connection pool not JDBC.

@cemo if you want jdbc metrics, see my comment about slick-micrometer sample

Thanks I will take a look.

@pjfanning nice job.

Brave's py6spy adds some instrumentation to the DB in terms of tracing - https://github.com/openzipkin/brave/tree/master/instrumentation/p6spy

FlexyPool has flexy-micrometer-metrics module.
https://github.com/vladmihalcea/flexy-pool

here is a metrics list.
https://github.com/vladmihalcea/flexy-pool/wiki/User-Guide#metrics

Was this page helpful?
0 / 5 - 0 ratings