Skip to content
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

Add metrics for SQL queries #17

Open
gavlyukovskiy opened this issue May 26, 2018 · 2 comments
Open

Add metrics for SQL queries #17

gavlyukovskiy opened this issue May 26, 2018 · 2 comments

Comments

@gavlyukovskiy
Copy link
Owner

No description provided.

@uqix
Copy link

uqix commented Feb 27, 2021

Any plan? I thought decorator.datasource.datasource-proxy.count-query=true would expose those metrics to actuator/prometheus.

@gavlyukovskiy
Copy link
Owner Author

That was the case before Spring Boot 2.0, after that they replaced in-house counters with Micrometer, now it only registers counter so you can have access to QueryCount at runtime - QueryCountHolder.getGrandTotal() or QueryCountHolder.get(dataSourceName). These counts can be used in tests, but I don't think they are particularly useful for applications running in production.
Initial goal of this ticket was to measure things like query timings, but the problem is that it's quite hard (from JDBC perspective) to correlate particular SQL query with the code and at the same time most databases provide much more better insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants