Prometheus support with daemon enabled

Is it possible to set up prometheus support using the javaagent with Looker in daemon mode?

Running it without any change results in a “Address already in use” error due to the java process forking itself as part of demonization.

A glance at our internal processes says that since we use JMX to monitor the Looker processes, something like https://github.com/prometheus/jmx_exporter to make JMX available to prometheus may work.

I’m not 100% clear on the daemonization piece of the puzzle, but that JMX exporter can be run as a javaagent and bound to a specific IP you provide.

Thanks, Izzy - we were using the javaagent (your link above) already. What I figured out eventually was that I could use the Java VirtualMachine class and a relatively recent (>= 0.11.0) of the java agent to attach the agent after daemonization occurred, rather than specifying at startup time via -javaagent (which would lead to the problem I described).

1 Like