简体   繁体   中英

can “jmx exporter” be used without compliling my spring boot Application in jar file?

In official git repository ( https://github.com/prometheus/jmx_exporter ), i see i need to use this command "java -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml -jar yourJar.jar ". I am running my Spring Boot Application in my eclipse without compiling in jar format.

So how can i get the metrics from jmx exporter without compiling my spring app in jar file. Can anybody pls help me solve this issue.

You need to modify "Run configuration" in your Eclipse IDE to include necessary JVM arguments as you shown in question ( java -javaagent:./jmx_prometheus_javaagent-0.16.1.jar=8080:config.yaml ). For details check this answer on how to do it.

Jar file ( jmx_prometheus_javaagent-0.16.1.jar ) and YAML file ( config.yaml ) has to be in current working directory, otherwise you might need to provide full path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM