Closed ecerulm closed 6 months ago
@ecerulm we have a subtle statement...
"It can be also run as a standalone HTTP server and scrape remote JMX targets, but this has various disadvantages, such as being harder to configure and being unable to expose process metrics (e.g., memory and CPU usage)."
What would you propose?
The standalone can export JVM metrics, but they will be reported more in line with the actual MBean ObjectNames...
Example:
# HELP java_lang_threading_daemonthreadcount java.lang:name=null,type=Threading,attribute=DaemonThreadCount
# TYPE java_lang_threading_daemonthreadcount untyped
java_lang_threading_daemonthreadcount 58.0
What would you propose?
I wrote #965 with a specific proposal. My issues is that I tried searching for jvm_
in the docs and I could find any reference.
The standalone can export JVM metrics, but they will be reported more in line with the actual MBean ObjectNames...
And that is perfectly fine, it just that jvm_threads_daemon
, jvm_memory_bytes_used
mentioned in some AWS docs and then I couldn't find any reference to those. It took me a bit to realize that javagent exposed jvm_
but httpserver didn't. Now I know, but hopefully #965 change will allow other people to realize quicker that I did 😃
In my case I can't use the javagent because the application I'm trying to monitor (Tableau) does not allow me to add the agent. It comes with it's own tool to start many java services and it does not allow to customize any java options (not supported either). But "regular" JMX is allowed, hence jmxexporter http server is a good fit for me.
The standalone can export JVM metrics, but they will be reported more in line with the actual MBean ObjectNames...
Many (most?) of the JVM metrics are directly accessible from MBeans attributes, yes.
Some other jvm metrics like jvm_threads_deadlocked
(jmxexporter-javaagent) are simply not accessible via MBean attributes and therefore you can't get them with the jmxexporter-httpserver. In particular jvm_threads_deadlocked
is implemented in client_java's JvmThreadsMetrics and it uses a MBean operation (not an attribute). JvmThreadsMetrics
will call ThreadMXBean.findMonitorDeadlockedThreads
on the MBean.
The above is just for reference in case somebody lands here looking for jvm_threads_deadlocked
in jmxexporter-httpserver.
FYI, I added some information about jvm_*
metrics on this stackoverflow answer.
Added documentation to 1.0.1 README.md
I thought that the metrics
were "standard" in jmx_exporter but it seems that they are only exported for the javagent and not the httpserver. I don't think this is mentioned in the documentation, I think it would be good to clarify somewhere the discrepancy between javaagent in httpserver.
Just to illustrate my point
httpserver
Running the jmxexporter httpserver give 0
jvm_
metricsjavaagent
On the other hand jmxexporter agent give a 98
jvm_
metrics