I have configured javamelody 1.86.0 on Tomcat 8.8 and all the other metrics are captured except from the JDBC. Below are the config I have on the Tomcat application:
Context.xml:
<ResourceLink type="javax.sql.DataSource"
name="jdbc/LocalAPIDB"
global="jdbc/APIDB"/>
Server.xml:
<Resource type="javax.sql.DataSource"
name="jdbc/APIDB"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/apiDB"
username="xxxx"
password="xxxxx"
initialSize="340"
maxActive="3770"
maxIdle="2330"
minIdle="890"
testOnBorrow="true"
validationQuery="SELECT 1"
validationInterval="30000"
timeBetweenEvictionRunsMillis="5000"
minEvictableIdleTimeMillis="60000"
removeAbandoned="true"
removeAbandonedTimeout="60"
abandonWhenPercentageFull="0"
logAbandoned="true"
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer"/>
On mbeans I can see there are active connections but on the graph nothing is captured.
JDBC Graph

MBeans

Debugging Logs

I suggest that you move the Resource from server.xml to the xml context file of the webapp (
conf/Catalina/localhost/MpesaIntegrations.xml) and that you remove the ResourceLink.So the xml context file of the webapp is like this:
And/or, if that's not enough, you probably have a listener or filter in your webapp that is getting and keeping in cache the DataSource. In that case, put the javamelody listener and filter near the top of your WEB-INF/web.xml file.