Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse simple HTTP Server #162
Conversation
Thanks, we'll need to wait until the change over in client_java is in and released. I'm just doing a release for another issue right now. |
|
||
if (hostnamePort.length == 2) { | ||
port = Integer.parseInt(hostnamePort[1]); | ||
socket = new InetSocketAddress(hostnamePort[0], port); |
brian-brazil
Jul 10, 2017
Member
We'll want to keep the existing host support around.
We'll want to keep the existing host support around.
leogomes
Jul 10, 2017
Author
Contributor
Sure, I will put it back once HTTP server is able to take a host and port. I can do the modification and test, if you want.
Sure, I will put it back once HTTP server is able to take a host and port. I can do the modification and test, if you want.
new JmxCollector(new File(args[1])).register(); | ||
final HTTPServer server = new HTTPServer(socket, CollectorRegistry.defaultRegistry); | ||
|
||
Runtime.getRuntime().addShutdownHook(new Thread() { |
brian-brazil
Jul 13, 2017
Member
We don't need this, the httpserver should keep going until the process dies.
There could be a long time between the TERM and the process actually dying.
We don't need this, the httpserver should keep going until the process dies.
There could be a long time between the TERM and the process actually dying.
@@ -22,12 +22,12 @@ | |||
<dependency> | |||
<groupId>io.prometheus</groupId> | |||
<artifactId>simpleclient_servlet</artifactId> | |||
<version>0.0.21</version> | |||
<version>0.0.26-SNAPSHOT</version> |
brian-brazil
Jul 13, 2017
Member
0.0.25. We don't use snapshot releases in production.
0.0.25. We don't use snapshot releases in production.
server.start(); | ||
server.join(); | ||
new JmxCollector(new File(args[1])).register(); | ||
new HTTPServer(socket, CollectorRegistry.defaultRegistry); |
brian-brazil
Jul 13, 2017
Member
There're nothing here to wait, this will shutdown immediately.
There're nothing here to wait, this will shutdown immediately.
leogomes
Jul 14, 2017
Author
Contributor
Not really, HTTPServer creates threads that will keep running, even if the main thread exits, c.f. termination of main thread exit.
You can run the PR locally as well.
Not really, HTTPServer creates threads that will keep running, even if the main thread exits, c.f. termination of main thread exit.
You can run the PR locally as well.
@@ -23,12 +22,12 @@ | |||
<dependency> | |||
<groupId>io.prometheus</groupId> | |||
<artifactId>simpleclient_servlet</artifactId> |
brian-brazil
Jul 14, 2017
Member
You don't need this any more
You don't need this any more
Thanks! |
Motivation:
#155
Modifications:
Changed the code of both the agent and external HTTP process to use the simple HTTP server provided on prometheus/client_java#73
Result:
JMX exporter works with the simple HTTP Server.