java -javaagent:./jmx_prometheus_javaagent-0.13.0.jar=9090:config.yaml -jar 
Main.jar

How can I do it from a program.

I tried these. no luck!!
try{ String nameOfRunningVM = 
ManagementFactory.getRuntimeMXBean().getName(); String pid = 
nameOfRunningVM.substring(0, nameOfRunningVM.indexOf('@')); VirtualMachine 
vm = VirtualMachine.attach(pid); 
vm.loadAgent("/Users/zop2816/Downloads/jmx_prometheus_javaagent-0.13.0.jar=9090:/Users/zop2816/Downloads/example.java.helloworld-master/config.yaml",
 
null); vm.detach(); }catch (Exception e) { Exception o = e; 
e.printStackTrace(); } 

Please help. TIA.

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/ce7fccf4-db76-4b0d-8a91-e3bf6ace5f21n%40googlegroups.com.

Reply via email to