Is it still a bad idea to use JMX metrics in production?

931 views
Skip to first unread message

David Karr

unread,
Oct 5, 2016, 3:58:08 PM10/5/16
to metrics-user
(This may be a double-post. google groups is having some trouble.)

On the core doc page, I found the following statement:

Warning

We don’t recommend that you try to gather metrics from your production environment. JMX’s RPC API is fragile and bonkers. For development purposes and browsing, though, it can be very useful.


The principal reason I was considering using this framework was for monitoring statistics in production with JMX.  Is the statement made here still relevant?  I was considering using the Metrics library to gather the metrics, but use a custom REST interface to provide the data.  Considering this statement, is that a reasonable strategy?

Marshall Pierce

unread,
Oct 5, 2016, 6:01:28 PM10/5/16
to metric...@googlegroups.com
Note that you could use something like https://jolokia.org/ to expose JMX MBeans over HTTP. The problem with JMX is when you use the (default) Java-serialization-over-TCP way of accessing remote JVMs, which is operationally problematic for a whole host of reasons. The MBeans themselves aren’t inherently annoying.

So, custom REST is fine, but Jolokia may already do what you need.
> --
> You received this message because you are subscribed to the Google Groups "metrics-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Erik van Oosten

unread,
Oct 6, 2016, 3:42:49 PM10/6/16
to metric...@googlegroups.com

I was considering using the Metrics library to gather the metrics, but use a custom REST interface to provide the data.  Considering this statement, is that a reasonable strategy?

For a small service that is absolutely fine. For a larger, or longer running environment I would recommend to push the data to a metrics-store and use that to serve your graphs and monitoring needs. Ganglia and Graphite are supported directly but there is support for more in third party extensions. Pushing data has the advantage that you don't need to figure out what to poll.

Kind regards,
    Erik.


Op 05-10-16 om 21:58 schreef David Karr:

Isuru Perera

unread,
Oct 11, 2016, 7:13:50 AM10/11/16
to metric...@googlegroups.com
Hi David,

I suppose that you are talking about the JMX Metrics given by the metrics-jvm module [1], right? Or else, do you talk about your own metrics exposed with JMX Reporter?

I don't understand why there is a warning. Does that mean that the Metrics exposed via JMX Reporter shouldn't be used with another JMX monitoring tool?

--
You received this message because you are subscribed to the Google Groups "metrics-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Erik van Oosten

unread,
Oct 12, 2016, 4:55:06 AM10/12/16
to metric...@googlegroups.com

Does that mean that the Metrics exposed via JMX Reporter shouldn't be used with another JMX monitoring tool?

No, it means that if you try you will encounter a lot of pain. But in the end it will probably work.

Kind regards,
    Erik.

Op 11-10-16 om 13:13 schreef Isuru Perera:
To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages