I added the JMX exporter and am getting the following errors:
Now, I am getting metrics not found error.




*threadPoolSizestatementDestroyerNumActiveThreadsstatementCacheNumStatementsDefaultUsernumIdleConnections*

Caused by: java.sql.SQLException: 
com.mchange.v2.c3p0.PoolBackedDataSource@9f36a249 [ 
connectionPoolDataSource -> 
com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@f0a74fac [ 
acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 
1000, autoCommitOnClose -> false, automaticTestTable -> null, 
breakAfterAcquireFailure -> false, checkoutTimeout -> 0, 
connectionCustomizerClassName -> null, connectionTesterClassName -> 
com.mchange.v2.c3p0.impl.DefaultConnectionTester, 
debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> 
null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 
2xxawwa11ttr753pjoklx|60a5d9f1, idleConnectionTestPeriod -> 100, 
initialPoolSize -> 0, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 
0, maxIdleTime -> 30, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, 
maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 0, 
nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@a6b636b6 [ 
description -> null, driverClass -> null, factoryClassLocation -> null, 
identityToken -> 2xxawwa11ttr753pjoklx|21505e71, jdbcUrl -> 
jdbc:postgresql://prcroe00.cjvfzcpnts8z.us-east-1.rds.amazonaws.com:5432/prcroe00?ssl=true&reWriteBatchedInserts=true,
 
properties -> {user=*, password=*} ], preferredTestQuery -> null, 
propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, 
testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, 
unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> 
false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> 
null, identityToken -> 2xxawwa11ttr753pjoklx|7152181d, numHelperThreads -> 
3 ] has been closed() -- you can no longer use it. at 
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.assertCpds(AbstractPoolBackedDataSource.java:507)
 
at 
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getPoolManager(AbstractPoolBackedDataSource.java:519)
 
at 
com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getNumFailedIdleTestsDefaultUser(AbstractPoolBackedDataSource.java:212)

*Version*
Java :- 1.6Tomcat 7.0Prometheus agent:- jmx_prometheus_javaagent-0.13.0.jar


*We are also using liferay framework in tomcat.We are using kubernetes to 
run this stack. I can see in the logs Pod which indicates agent started as 
expected*
15-Sep-2020 05:11:21.874 CONFIG [main] sun.net.httpserver.ServerImpl. 
HttpServer created http /0.0.0.0:5000
15-Sep-2020 05:11:21.890 CONFIG [main] 
sun.net.httpserver.ServerImpl.createContext context created: /
15-Sep-2020 05:11:21.890 CONFIG [main] 
sun.net.httpserver.ServerImpl.createContext context created: /metrics
15-Sep-2020 05:11:21.890 CONFIG [main] 
sun.net.httpserver.ServerImpl.createContext context created: /-/healthy
15-Sep-2020 05:11:22.262 CONFIG [main] ConnectorBootstrap.initialize JMX 
Connector ready at: 
service:jmx:rmi:///jndi/rmi://pwr-wap-6bd8f54dcd-tqf55:5005/jmxrmi

*But after 10 seconds tomcat starting the liferay at this time i am getting*
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:411)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:525)
at sun.net.www.http.HttpClient.(HttpClient.java:208)
at sun.net.www.http.HttpClient.New(HttpClient.java:291)
at sun.net.www.http.HttpClient.New(HttpClient.java:310)
at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:987)
at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:923)
at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841)
at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at 
au.com.pickles.pwr.service.mailinglist.MailingListServiceImpl.(MailingListServiceImpl.java:59)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:108)
at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
at 
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
This error. If I don't use Prometheus agent then its working as expected.

*I am adding Prometheus servers configurations in the setenv.sh file of 
tomcat. As below:-*

JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8 
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false 
-Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=256m"
#JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8 
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false"
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=5005 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false 
-Djava.rmi.server.hostname=localhost 
-javaagent:/opt/liferay/jmx_prometheus_javaagent-0.13.0.jar=5000:/opt/liferay/tomcat.yml"

*Is this Prometheus agent is compatible with java 1.6 version of it require 
newversion of java to run.*

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/26b2f5e8-45bf-4f3f-8fa0-06dd285aa71fn%40googlegroups.com.

Reply via email to