lamber-ken edited a comment on issue #1045: [HUDI-209] Implement JMX metrics reporter URL: https://github.com/apache/incubator-hudi/pull/1045#issuecomment-557800086 > > hi, @XuQianJin-Stars. > > if use `JmxReporter.forRegistry(registry).build().start()` to create the JmxReporter, user can only use jconsole or jvisualvm to get the metrics. How to connect the jvm by jmx port? > > hi @lamber-ken Yes, open the jmx port to be accessed. Yes, but if we deploy the application on yarn cluster in product, it's not reasonable to config the jmx port for each application, and the jmx port may be be conflicts. what about the bellow program, we can control the jmx port in our program, and update metrics by `ManagementFactory.getPlatformMBeanServer();` ``` public void start(int port) throws Exception { LocateRegistry.createRegistry(port); String serviceUrl = "service:jmx:rmi://localhost:" + port + "/jndi/rmi://localhost:" + port + "/jmxrmi"; JMXServiceURL url = new JMXServiceURL(serviceUrl); JMXConnectorServer connector = JMXConnectorServerFactory.newJMXConnectorServer(url, null, ManagementFactory.getPlatformMBeanServer()); connector.start(); } ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
