Skip to content

Example implementation of using the jmx_exporter for Prometheus in a Docker container

Notifications You must be signed in to change notification settings

douglas-gibbons/prometheus-jmx-exporter-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Example Docker Image Using Prometheus jmx_exporter

See jmx_exporter for full usage.

This is an example build of a Docker image which runs Jetty and exposes JMX statistics for Prometheus over HTTP on port 9093 at /metrics

Build Prometheus JMX Exporter JAR

Simple:

git clone git@github.com:prometheus/jmx_exporter.git
docker run -it --volume=`pwd`/jmx_exporter:/usr/src/app -w /usr/src/app maven mvn clean install
cp jmx_exporter/jmx_prometheus_javaagent/target/jmx_prometheus_javaagent-0.7-SNAPSHOT.jar .

Build the Docker Image

Only the usual magic:

docker build .

Running it

docker run -p 8080:8080 -p 9093:9093 <image ID>

Testing it

Form the host machine:

curl localhost:9093/metrics

About

Example implementation of using the jmx_exporter for Prometheus in a Docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published