I have found the following manual https://code.google.com/p/javamelody/wiki/UserGuideAdvanced#JPA_monitoring
It contains some info regarding the changes I should make in persistence.xml
in order to let JavaMelody gather JPA/SQL statistics.
However, it's not quite clear to me, whether should I replace existing provider
with JavaMelody
-provider, or should I put it to a separate persistence unit?
I tried the former option, but it broken the application (build failed with the error like 'cannot cast some proxy to EntityManagerFactory').