Micrometer: Add Timer instrumentation to Spring Data Interfaces

Created on 29 Mar 2018  路  7Comments  路  Source: micrometer-metrics/micrometer

It would be valuable to have timer instrumentation on all children of the Spring Data Repository interface. Metric name along the lines of of spring.data.repository with tags for method name (save, findOne, exists, etc.) and success/failure.

external-project spring-boot change

Most helpful comment

Hi, is there any progress on this? This issue is open for a while now and very interesting for us as we could get rid of some Workarounds

All 7 comments

Discussed this with Adrian and Marcin. Zipkin's Brave provides p6spy tracing. To the extent you are willing to add a p6spy layer between your app and driver, we could take advantage of this.

That'd be excellent for tracing, but I think not very good for readable metric names. It seems to be tracking things at the query level, whereas the interface methods put a much more accessible name on top of those (likely verbose) queries.
PersonController.getById vs select * from person where id=%id.
Also, this looks limited to jdbc whereas I'd want to cover the full suite of Spring Data techs, (redis, cassandra, etc.)

Feels like that might be better in a spring-cloud-sleuth-extensions project for the tracing benefits.

We created similar to #500 interceptor especially for spring data use case, probably you can at least copy it to your project.

Hi, is there any progress on this? This issue is open for a while now and very interesting for us as we could get rid of some Workarounds

I'm interested in something similar for use with Retrofit2.

Closing this since it suppose to go out with Spring Boot 2.5.0-RC1 (2.5.0).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nugnoperku picture nugnoperku  路  4Comments

adrianboimvaser picture adrianboimvaser  路  3Comments

jonatan-ivanov picture jonatan-ivanov  路  3Comments

ffeltrinelli picture ffeltrinelli  路  4Comments

pjfanning picture pjfanning  路  3Comments