This is python client for collecting IBM Integration Bus metrics and exporting to Prometheus pushgateway. The collected metrics can be explored in Prometheus or Grafana.
The metrics are collected by using mqsilist command. The metrics are collected for all local Brokers. You need to run IB metrics pyclient
in the same host where IBM Integration Bus
was installed.
Tested for IBM IB v9 and v10 and Python 3.6, 3.7 on Linux.
By default, metrics are collected every 60 seconds.
The metrics provided by the client:
ib_broker_status...
- current status of IB broker;ib_exec_group_status...
- current status of IB execution group;ib_application_status...
- current status of IB application;ib_message_flow_status...
- current status of IB message flow.
See detailed description of the metrics for an in-depth understanding.
You can run IB metrics pyclient
and MQ metrics pyclient together. Metrics from both clients will be sent to the same pushgateway. Conflicts will not arise.
Download Prometheus Pushgateway from the release page and unpack the tarball.
cd pushgateway
nohup ./pushgateway > pushgateway.log &
For Pushgateway the default port is used (":9091").
git clone https://github.com/AATools/ib-metrics-pyclient
cd ib-metrics-pyclient
nohup python3 iib_metrics_client.py &
After that, you should set up your Prometheus server to collect metrics from Pushgateway (http://<hostname>:9091/metrics
).
You can specify host
and port
for pushgateway, Integration Bus version and time interval in seconds between collecting metrics via command-line arguments.
python3 iib_metrics_client.py -h
usage: iib_metrics_client.py [-h] [--pghost [pushgatewayHost]] [--pgport [pushgatewayPort]] [--iibver [iibVersion]] [--collectint [collectInterval]]
optional arguments:
-h, --help show this help message and exit
--pghost [pushgatewayHost]
pushgateway host
--pgport [pushgatewayPort]
pushgateway port
--iibver [iibVersion]
IIB version: 9 or 10
--collectint [collectInterval]
time interval between collecting metrics
If argument is not set the default value is used.
Command-line argument | Description | Default value |
---|---|---|
pghost |
Pushgateway host | Hostname on which client is started. Value define via platform.node() . |
pgport |
Pushgateway port | 9091 |
iibver |
IIB version | 9 Valid value: 9 or 10. If argument is omitted or invalid value is passed, the client will try to determine version via environment variable MQSI_VERSION_V . If it can't determine the version using the environment variable, the default value will be used. |
collectint |
Time interval between collecting metrics | 60 Time in seconds. |
The Grafana dashboard visualizes collected metrics. This is an example of a dashboard. You can create your own dashboards to analyze metrics.
Metric | Description |
---|---|
ib_broker_status | The metric shows current status of IB broker. Metric type: gauge .If there are several brokers on host, there will be a own metric for each broker. Possible values: 0 - STOPPED;1 - RUNNING.Example display in Pushgateway: ib_broker_status{brokername="BRK1",instance="",job="BRK1",qmname="QM1"} 1 |
ib_exec_group_status | The metric shows current status of IB execution group. Metric type: gauge .If there are several execution groups on host, there will be a own metric for each execution group. Possible values: 0 - STOPPED;1 - RUNNING.Example display in Pushgateway: ib_exec_group_status{brokername="BRK1",egname="EG1",instance="",job="BRK1"} 1 |
ib_application_status | The metric shows current status of IB application. Metric type: gauge .If there are several applications on host, there will be a own metric for each application. Possible values: 0 - STOPPED;1 - RUNNING.Example display in Pushgateway: ib_application_status{appname="Application1",brokername="BRK1",egname="EG1",instance="",job="BRK1"} 1 |
ib_message_flow_status | The metric shows current status of IB message flow. Metric type: gauge .If there are several message flows on host, there will be a own metric for each message flow. Possible values: 0 - STOPPED;1 - RUNNING.Example display in Pushgateway: ib_message_flow_status{appname="Application1",brokername="BRK1",egname="EG1",instance="",job="BRK1",messageflowname="adapter.reply"} 1 |