Comments (10)
The HTTP connection from jmxtrans-agent embedded in your spring boot app to influxdb fails with a socket timeout ("SocketTimeoutException: Connect timed out").
You are likely to have a firewall issue between the springboot server and the influxdb server.
Could you try a curl http://xx.yy.zz.aa:8086
from the springboot server to verify that the network connectivity to the influxdb server is opened?
from jmxtrans-agent.
I thank you for your fast answer.
A curl from the server produces data.
curl -G 'http://xx.yy.yy.aa:8086/query?pretty=true' --data-urlencode "db=java_db" --data-urlencode "q=SELECT mean("value") AS "mean_value" FROM "java_db"."autogen"."ThreadCount" WHERE time > now() - 5m AND "host"='' AND "instance"='logstash' GROUP BY time(10s)"
retrieves :
{
"results": [
{
"statement_id": 0,
"series": [
{
"name": "ThreadCount",
"columns": [
"time",
"mean_value"
],
"values": [
[
"2017-09-20T08:26:40Z",
54
],
...snip...
54
],
[
"2017-09-20T08:31:40Z",
null
]
]
}
]
}
]
}
Furthermore, on the same server, a logstash is tooled the same way with the same jmxtrans-agent jar and xml without problem
But, it succesfully generates some data points before failing in stack.
it looks like something is interfering with the normal action of jmxtrans-agent.
from jmxtrans-agent.
from jmxtrans-agent.
from jmxtrans-agent.
@maogouste I have improved the troubleshooting messages with #112
Can you please test the jmxtrans-agent snapshot https://oss.sonatype.org/content/repositories/snapshots/org/jmxtrans/agent/jmxtrans-agent/1.2.7-SNAPSHOT/jmxtrans-agent-1.2.7-20170920.100756-1.jar and share with us the error message.
from jmxtrans-agent.
sept. 20 13:18:17 java[12860]: 2017-09-20 13:18:17.019 INFO [main] org.jmxtrans.agent.JmxTransAgent - Starting 'JMX metrics exporter agent: 1.2.7-SNAPSHOT' with configuration '/servers/jmxtrans-agent/jmxtrans-agent.xml'...
sept. 20 13:18:17 java[12860]: 2017-09-20 13:18:17.05 INFO [main] org.jmxtrans.agent.JmxTransAgent - PropertiesLoader: Empty Properties Loader
sept. 20 13:18:17 java[12860]: 2017-09-20 13:18:17.558 INFO [main] org.jmxtrans.agent.influxdb.InfluxDbOutputWriter - InfluxDbOutputWriter is configured with url=http://xx.yy.zz.aa:8086, database=java_db, user=null, password=null, tags=host=servername,instance=dots-server_01, connectTimeoutMills=3000, readTimeoutMillis=5000
sept. 20 13:18:17 java[12860]: 2017-09-20 13:18:17.583 INFO [main] org.jmxtrans.agent.JmxTransExporter - Configuration reload interval: 60secs
sept. 20 13:18:17 java[12860]: 2017-09-20 13:18:17.584 INFO [main] org.jmxtrans.agent.JmxTransAgent - JmxTransAgent started with configuration '/servers/jmxtrans-agent/jmxtrans-agent.xml'
sept. 20 13:18:58 java[12860]: 2017-09-20 13:18:58.904 WARNING [jmxtrans-agent-1] org.jmxtrans.agent.JmxTransExporter - Ignore exception flushing metrics
sept. 20 13:18:58 java[12860]: java.io.IOException: Exception sending metrics to 'http://xx.yy.zz.aa:8086/write?precision=ms&db=java_db': java.net.SocketTimeoutException: Connect timed out
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.influxdb.InfluxDbOutputWriter.sendMetrics(InfluxDbOutputWriter.java:161)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.influxdb.InfluxDbOutputWriter.postCollect(InfluxDbOutputWriter.java:153)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.OutputWriterCircuitBreakerDecorator.postCollect(OutputWriterCircuitBreakerDecorator.java:124)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.OutputWritersChain.postCollect(OutputWritersChain.java:70)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.JmxTransExporter.collectAndExport(JmxTransExporter.java:214)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.JmxTransExporter$2.run(JmxTransExporter.java:131)
sept. 20 13:18:58 java[12860]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
sept. 20 13:18:58 java[12860]: at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
sept. 20 13:18:58 java[12860]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
sept. 20 13:18:58 java[12860]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
sept. 20 13:18:58 java[12860]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
sept. 20 13:18:58 java[12860]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
sept. 20 13:18:58 java[12860]: at java.lang.Thread.run(Thread.java:748)
sept. 20 13:18:58 java[12860]: Caused by: java.net.SocketTimeoutException: Connect timed out
sept. 20 13:18:58 java[12860]: at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:126)
sept. 20 13:18:58 java[12860]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:502)
sept. 20 13:18:58 java[12860]: at java.net.Socket.connect(Socket.java:589)
sept. 20 13:18:58 java[12860]: at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
sept. 20 13:18:58 java[12860]: at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
sept. 20 13:18:58 java[12860]: at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
sept. 20 13:18:58 java[12860]: at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
sept. 20 13:18:58 java[12860]: at sun.net.www.http.HttpClient.New(HttpClient.java:339)
sept. 20 13:18:58 java[12860]: at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1209)
sept. 20 13:18:58 java[12860]: at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1157)
sept. 20 13:18:58 java[12860]: at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
sept. 20 13:18:58 java[12860]: at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
sept. 20 13:18:58 java[12860]: at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316)
sept. 20 13:18:58 java[12860]: at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.influxdb.InfluxDbOutputWriter.writeMetrics(InfluxDbOutputWriter.java:204)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.influxdb.InfluxDbOutputWriter.sendMetrics(InfluxDbOutputWriter.java:170)
sept. 20 13:18:58 java[12860]: at org.jmxtrans.agent.influxdb.InfluxDbOutputWriter.sendMetrics(InfluxDbOutputWriter.java:159)
sept. 20 13:18:58 java[12860]: ... 12 more
from jmxtrans-agent.
@maogouste you have a connect timeout when the JVM tries to open an HTTP socket on port 8086 to the IP xx.yy.zz.aa.
If a curl http://xx.yy.zz.aa:8086
is successful when the JVM is not, then there may be an http proxy issue. Could you go through an http proxy when using curl but not when using java or vice versa?
Can you try to execute from the application server the following command to test a jvm access to :http://xx.yy.zz.aa:808
jrunscript -e "println(new java.net.URL(\"http://xx.yy.zz.aa:8086\").openConnection().getResponseCode())"
from jmxtrans-agent.
It says 404
from jmxtrans-agent.
I think I understood, the http connection from your java application seem to go through a Sock Proxy as you can see java.net.SocksSocketImpl.connect
in the stack trace.
Shouldn't you exclude the ip address of your influxdb server from your jvm proxy config?
sept. 19 16:27:56 java[79309]: java.net.SocketTimeoutException: Connect timed out
sept. 19 16:27:56 java[79309]: at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:126)
sept. 19 16:27:56 java[79309]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:502)
sept. 19 16:27:56 java[79309]: at java.net.Socket.connect(Socket.java:589)
sept. 19 16:27:56 java[79309]: at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
sept. 19 16:27:56 java[79309]: at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
from jmxtrans-agent.
The jmxtrans-agent connection should pass directly. No proxy of any kind needed.
But, proxies are defined for the corporate application.
Is it possible to define our own? In this case, none?
from jmxtrans-agent.
Related Issues (20)
- JBOSS (EAP 7.1.0) JMX Attributes disappear while running jmxtrans-agent HOT 11
- Disable logging for JMX trans agent HOT 4
- Multi-tag issue in StatsDOutputWriter
- Flow not working with JDK 1.6
- Add Security Manager Policy
- JMXTransAgent with a jboss/wildfly and JDK 1.9 (-Xbootclasspath gone)? HOT 5
- RollingFileOutputWriter writes additional empty line when setting 'singleLine' is true HOT 2
- Springboot application - Issue in fetching tomcat threads and datasources
- Hinders Tomcat from starting MBeans
- Help with the parameters for the constructor class Invocation HOT 4
- jmxtrans-agent.xml example with <invocations> block
- Only getting first attribute for java.lang:type=OperatingSystem HOT 1
- JMXTrans data to statsd comes multipe times HOT 2
- How do i capture springboot datasource for springboot versions before 1.5.5
- Please post JARs for lastest three releases HOT 2
- jmxtrans-agent to use in spring boot application
- numQueryThreads parameter tuning HOT 1
- Got java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip() testing the version 1.2.11-rc-2 HOT 4
- Is InfluxDbOutputWriter still considered experimental? HOT 3
- How to set log level for jmxtrans-agent HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmxtrans-agent.