prometheus / jmx_exporter

A process for exposing JMX Beans via HTTP for Prometheus consumption
Apache License 2.0
3.02k stars 1.2k forks source link

jms weblogic message queue #642

Closed jijojohn1985 closed 4 months ago

jijojohn1985 commented 2 years ago

Hello @Yannig & @brian-brazil

can you please help to get the jms weblogic message queue from this jmx_exporter/example_configs/weblogic.yml.

Regards, Jijo John

Yannig commented 2 years ago

You have to find the mbeans that interest you and then convert them. A good way to do this is to add the following configuration tip in the JMX exporter conf:

# Retrieve all metrics
rules:
- pattern: ".*"

Find the mbeans that interest you and create the conversion rules by taking an example from this existing one (https://github.com/prometheus/jmx_exporter/blob/master/example_configs/weblogic.yml).

Be careful not to connect Prometheus during the debugging phase!

Make the modifications directly on the file and open the entry point of the exporter in a browser. At each change use F5 to see the result (no need to restart things). When you are satisfied, plug Prometheus into it.

jijojohn1985 commented 2 years ago

Thankyou @Yannig . I got all the queues (current & pending) using the below pattern.

- pattern: "com.bea<ServerRuntime=(.+), Name=(.+), Type=(.+), JMSServerRuntime=(.+)<>(MessagesCurrentCount|MessagesPendingCount)"

But , this is giving me 150+ queues

Using WLST py script below , i was able to fetch the total queue for each managed servers.

for server in servers:
        jms_runtime = server.getJMSRuntime()
        jms_servers = jms_runtime.getJMSServers()
        for jms_server in jms_servers:
                msg_cur_cnt = jms_server.messagesCurrentCount
                msg_pen_cnt = jms_server.messagesPendingCount
                print('Current Queue',server.getName(),msg_cur_cnt)
                print('Pending Queue',server.getName(),msg_pen_cnt)

Can i get the same from exporter output also, instead of getting each and every queue.

Thanks, Jijo John