Skip to content

Commit

Permalink
Prevent hanging on exit (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpaggi authored and brian-brazil committed Oct 25, 2017
1 parent 0733a73 commit 88e77a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jmx_prometheus_httpserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>0.0.26</version>
<version>0.1.0</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions jmx_prometheus_javaagent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>0.0.26</version>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>0.0.26</version>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import io.prometheus.client.hotspot.DefaultExports;

public class JavaAgent {

static HTTPServer server;

public static void premain(String agentArgument, Instrumentation instrumentation) throws Exception {
Expand All @@ -35,6 +35,6 @@ public static void premain(String agentArgument, Instrumentation instrumentation

new JmxCollector(new File(file)).register();
DefaultExports.initialize();
server = new HTTPServer(socket, CollectorRegistry.defaultRegistry);
server = new HTTPServer(socket, CollectorRegistry.defaultRegistry, true);
}
}

0 comments on commit 88e77a1

Please sign in to comment.