How to enable JMX monitoring in gerrit

293 views
Skip to first unread message

Arun m

unread,
Jun 3, 2019, 3:31:34 AM6/3/19
to Repo and Gerrit Discussion
Hello everyone,

Currently, we are using javamelody to monitor gerrit.

We want to move to nagios monitoring and for this we need to enable jmx in gerrit.

How to expose jmx port in gerrit to pull data the memory and cpu metrics. Can some one help ?

Matthias Sohn

unread,
Jun 3, 2019, 3:47:06 AM6/3/19
to Arun m, Repo and Gerrit Discussion
Install the metrics-reporter-jmx plugin [1] and follow [2]. If you also want to enable Jetty MBeans set
httpd.registerMBeans=true [3].


-Matthias

Kiran Shinde

unread,
Mar 2, 2020, 5:13:14 AM3/2/20
to Repo and Gerrit Discussion
Hi Arun,

Were you able to make it work with suggestions from Matthias?

Kiran Shinde

unread,
Mar 2, 2020, 5:40:00 AM3/2/20
to Repo and Gerrit Discussion
Hi Matthias,

We followed your recommendation and did below configuraitons in our gerrit.config

[container]
        user = gerrit
        javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
        heapLimit = 16g
        javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
        javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
        javaOptions = "-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1234"
        javaoptions = "-Dcom.sun.management.jmxremote.authenticate=false"
        javaoptions = " -Dcom.sun.management.jmxremote.ssl=false"
        javaoptions = "-Djava.rmi.server.hostname=localhost"

But we still do not see any metrics on port 1234.
Can you please suggest if we need more modifications to the config?

Best Regards,
Kiran

Matthias Sohn

unread,
Mar 2, 2020, 8:54:07 AM3/2/20
to Kiran Shinde, Repo and Gerrit Discussion
On Mon, Mar 2, 2020 at 11:40 AM Kiran Shinde <kkiran...@gmail.com> wrote:
Hi Matthias,

We followed your recommendation and did below configuraitons in our gerrit.config

[container]
        user = gerrit
        javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
        heapLimit = 16g
        javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
        javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
        javaOptions = "-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1234"
        javaoptions = "-Dcom.sun.management.jmxremote.authenticate=false"
        javaoptions = " -Dcom.sun.management.jmxremote.ssl=false"
        javaoptions = "-Djava.rmi.server.hostname=localhost"

But we still do not see any metrics on port 1234.

do you try to access JMX from the same host where Gerrit is running or from another machine ?
 
Can you please suggest if we need more modifications to the config?

Best Regards,
Kiran

On Monday, 3 June 2019 09:47:06 UTC+2, Matthias Sohn wrote:
On Mon, Jun 3, 2019 at 9:31 AM Arun m <arunma...@gmail.com> wrote:
Hello everyone,

Currently, we are using javamelody to monitor gerrit.

We want to move to nagios monitoring and for this we need to enable jmx in gerrit.

How to expose jmx port in gerrit to pull data the memory and cpu metrics. Can some one help ?

Install the metrics-reporter-jmx plugin [1] and follow [2]. If you also want to enable Jetty MBeans set
httpd.registerMBeans=true [3].


-Matthias

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/7ca812d7-6d2e-4a4c-afcb-e9a9d37360c4%40googlegroups.com.

Kiran Shinde

unread,
Mar 2, 2020, 10:44:32 AM3/2/20
to Repo and Gerrit Discussion
Hi Mattihas,

Sorry, I forgot to mention that we run Gerrit inside docker containers.
Host port 1234 is mapped to port 1234 inside container.

Should we use host IP below instead of localhost?
        javaoptions = "-Djava.rmi.server.hostname=localhost"

We have jconsole accessing JMX on a remote machine.

Best Regards,
Kiran
To unsubscribe, email repo-d...@googlegroups.com

More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-d...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages