Skip to content

Commit

Permalink
Merge pull request #83 from dtrejod/default-exports
Browse files Browse the repository at this point in the history
Add in Prometheus default java metric exports.
  • Loading branch information
Marky Jackson authored Jan 21, 2019
2 parents 8918be0 + dc04d7e commit 46f8037
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
<version>2.3.1</version>
</dependency>

<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import hudson.util.HttpResponses;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.dropwizard.DropwizardExports;
import io.prometheus.client.hotspot.DefaultExports;
import jenkins.metrics.api.Metrics;
import jenkins.model.Jenkins;
import org.acegisecurity.Authentication;
Expand Down Expand Up @@ -48,6 +49,7 @@ public Object doDynamic(StaplerRequest request) {
if (Metrics.metricRegistry() != null) {
collectorRegistry.register(new DropwizardExports(Metrics.metricRegistry()));
}
DefaultExports.initialize();
}
return MetricsRequest.prometheusResponse(collectorRegistry);
}
Expand Down

0 comments on commit 46f8037

Please sign in to comment.