Skip to content

Commit 119cea3

Browse files
committed
issue-9 additional metrics description added, config file updated with additional metrics
1 parent 7bdbee7 commit 119cea3

File tree

3 files changed

+165
-42
lines changed

3 files changed

+165
-42
lines changed

README.md

Lines changed: 143 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,42 @@
33
Prometheus exporter for IBM MQ, written in Java. Exposes API of IBM MQ and system metrics of it's host machine.
44

55
## Table of contents
6-
1. [Getting Started](https://github.com/Cinimex-Informatica/mq-java-exporter#getting-started)
7-
- [Compatibility](https://github.com/Cinimex-Informatica/mq-java-exporter#compatibility)
8-
- [Prerequisites](https://github.com/Cinimex-Informatica/mq-java-exporter#prerequisites)
9-
- [Dependencies](https://github.com/Cinimex-Informatica/mq-java-exporter#dependencies)
10-
- [Configuration](https://github.com/Cinimex-Informatica/mq-java-exporter#configuration)
11-
- [Build](https://github.com/Cinimex-Informatica/mq-java-exporter#build)
12-
2. [Metrics](https://github.com/Cinimex-Informatica/mq-java-exporter#metrics)
13-
- [Platform central processing units](https://github.com/Cinimex-Informatica/mq-java-exporter#platform-central-processing-units)
14-
- [CPU performance - platform wide](https://github.com/Cinimex-Informatica/mq-java-exporter#cpu-performance---platform-wide)
15-
- [CPU performance - running queue manager](https://github.com/Cinimex-Informatica/mq-java-exporter#cpu-performance---running-queue-manager)
16-
- [Platform persistent data stores](https://github.com/Cinimex-Informatica/mq-java-exporter#platform-persistent-data-stores)
17-
- [Disk usage - platform wide](https://github.com/Cinimex-Informatica/mq-java-exporter#disk-usage---platform-wide)
18-
- [Disk usage - running queue managers](https://github.com/Cinimex-Informatica/mq-java-exporter#disk-usage---running-queue-managers)
19-
- [Disk usage - queue manager recovery log](https://github.com/Cinimex-Informatica/mq-java-exporter#disk-usage---queue-manager-recovery-log)
20-
- [API usage statistics](https://github.com/Cinimex-Informatica/mq-java-exporter#api-usage-statistics)
21-
- [MQCONN and MQDISC](https://github.com/Cinimex-Informatica/mq-java-exporter#mqconn-and-mqdisc)
22-
- [MQOPEN and MQCLOSE](https://github.com/Cinimex-Informatica/mq-java-exporter#mqopen-and-mqclose)
23-
- [MQINQ and MQSET](https://github.com/Cinimex-Informatica/mq-java-exporter#mqinq-and-mqset)
24-
- [MQPUT](https://github.com/Cinimex-Informatica/mq-java-exporter#mqput)
25-
- [MQGET](https://github.com/Cinimex-Informatica/mq-java-exporter#mqget)
26-
- [Commit and rollback](https://github.com/Cinimex-Informatica/mq-java-exporter#commit-and-rollback)
27-
- [Subscribe](https://github.com/Cinimex-Informatica/mq-java-exporter#subscribe)
28-
- [Publish](https://github.com/Cinimex-Informatica/mq-java-exporter#publish)
29-
- [API per-queue usage statistics](https://github.com/Cinimex-Informatica/mq-java-exporter#api-per-queue-usage-statistics)
30-
- [MQOPEN and MQCLOSE](https://github.com/Cinimex-Informatica/mq-java-exporter#mqopen-and-mqclose-1)
31-
- [MQINQ and MQSET](https://github.com/Cinimex-Informatica/mq-java-exporter#mqinq-and-mqset-1)
32-
- [MQPUT and MQPUT1](https://github.com/Cinimex-Informatica/mq-java-exporter#mqput-and-mqput1)
33-
- [MQGET](https://github.com/Cinimex-Informatica/mq-java-exporter#mqget-1)
34-
3. [Issues and Contributions](https://github.com/Cinimex-Informatica/mq-java-exporter#issues-and-contributions)
35-
4. [Warning](https://github.com/Cinimex-Informatica/mq-java-exporter#warning)
36-
5. [License](https://github.com/Cinimex-Informatica/mq-java-exporter#license)
6+
1. [Getting Started](#getting-started)
7+
- [Compatibility](#compatibility)
8+
- [Prerequisites](#prerequisites)
9+
- [Dependencies](#dependencies)
10+
- [Configuration](#configuration)
11+
- [Build](#build)
12+
2. [Metrics](#metrics)
13+
- [Platform central processing units](#platform-central-processing-units)
14+
- [CPU performance - platform wide](#cpu-performance---platform-wide)
15+
- [CPU performance - running queue manager](#cpu-performance---running-queue-manager)
16+
- [Platform persistent data stores](#platform-persistent-data-stores)
17+
- [Disk usage - platform wide](#disk-usage---platform-wide)
18+
- [Disk usage - running queue managers](#disk-usage---running-queue-managers)
19+
- [Disk usage - queue manager recovery log](#disk-usage---queue-manager-recovery-log)
20+
- [API usage statistics](#api-usage-statistics)
21+
- [MQCONN and MQDISC](#mqconn-and-mqdisc)
22+
- [MQOPEN and MQCLOSE](#mqopen-and-mqclose)
23+
- [MQINQ and MQSET](#mqinq-and-mqset)
24+
- [MQPUT](#mqput)
25+
- [MQGET](#mqget)
26+
- [Commit and rollback](#commit-and-rollback)
27+
- [Subscribe](#subscribe)
28+
- [Publish](#publish)
29+
- [API per-queue usage statistics](#api-per-queue-usage-statistics)
30+
- [MQOPEN and MQCLOSE](#mqopen-and-mqclose-1)
31+
- [MQINQ and MQSET](#mqinq-and-mqset-1)
32+
- [MQPUT and MQPUT1](#mqput-and-mqput1)
33+
- [MQGET](#mqget-1)
34+
- [MQ PCF API specific statistics](#mq-pcf-api-specific-statistics)
35+
- [PCF requests](#pcf-requests)
36+
- [MQ constants mapping](#mq-constants-mapping)
37+
- [Channel status mapping](#channel-status-mapping)
38+
- [Listener status mapping](#listener-status-mapping)
39+
3. [Issues and Contributions](#issues-and-contributions)
40+
4. [Warning](#warning)
41+
5. [License](#license)
3742

3843
## Getting Started
3944

@@ -982,6 +987,113 @@ mvn package
982987
</tbody>
983988
</table>
984989

990+
#### MQ PCF API specific statistics
991+
##### PCF requests
992+
These metrics are collected via sending direct PCF commands to queue manager.
993+
<table>
994+
<tbody>
995+
<tr>
996+
<td><strong>Prometheus metric name</strong></td>
997+
<td><strong>Metric type</strong></td>
998+
<td><strong>Short description</strong></td>
999+
</tr>
1000+
<tr>
1001+
<td>mqobject_queue_max_depth_messages</td>
1002+
<td>gauge</td>
1003+
<td>Shows maximum number of messages that are allowed on the queue.</td>
1004+
</tr>
1005+
<tr>
1006+
<td>mqobject_channel_status_code</td>
1007+
<td>gauge</td>
1008+
<td>Shows current channel status.</td>
1009+
</tr>
1010+
<tr>
1011+
<td>mqobject_listener_status_code</td>
1012+
<td>gauge</td>
1013+
<td>Shows current listener status.</td>
1014+
</tr>
1015+
</tbody>
1016+
</table>
1017+
1018+
##### MQ constants mapping
1019+
###### Channel status mapping
1020+
<table>
1021+
<tbody>
1022+
<tr>
1023+
<td><strong>MQ channel status code</strong></td>
1024+
<td><strong>Prometheus metric value</strong></td>
1025+
</tr>
1026+
<tr>
1027+
<td>RUNNING</td>
1028+
<td>1</td>
1029+
</tr>
1030+
<tr>
1031+
<td>REQUESTING</td>
1032+
<td>0.8</td>
1033+
</tr>
1034+
<tr>
1035+
<td>PAUSED</td>
1036+
<td>0.7</td>
1037+
</tr>
1038+
<tr>
1039+
<td>BINDING</td>
1040+
<td>0.6</td>
1041+
</tr>
1042+
<tr>
1043+
<td>STARTING</td>
1044+
<td>0.5</td>
1045+
</tr>
1046+
<tr>
1047+
<td>INITIALIZING</td>
1048+
<td>0.4</td>
1049+
</tr>
1050+
<tr>
1051+
<td>SWITCHING</td>
1052+
<td>0.3</td>
1053+
</tr>
1054+
<tr>
1055+
<td>STOPPING</td>
1056+
<td>0.2</td>
1057+
</tr>
1058+
<tr>
1059+
<td>RETRYING</td>
1060+
<td>0.1</td>
1061+
</tr>
1062+
<tr>
1063+
<td>STOPPED</td>
1064+
<td>0</td>
1065+
</tr>
1066+
<tr>
1067+
<td>INACTIVE</td>
1068+
<td>-1</td>
1069+
</tr>
1070+
</tbody>
1071+
</table>
1072+
1073+
<b>Warning</b>: INACTIVE status correctness is not guaranteed. If channel has status INACTIVE, there is no way to retrieve it's status by PCF command (because technically channel has no status) and MQRCCF_CHL_STATUS_NOT_FOUND will be returned by queue manager. Since INACTIVE status of the channel is the most frequent reason for receiving such an error, we interpret it as INACTIVE status of the channel.
1074+
1075+
###### Listener status mapping
1076+
<table>
1077+
<tbody>
1078+
<tr>
1079+
<td><strong>MQ listener status code</strong></td>
1080+
<td><strong>Prometheus metric value</strong></td>
1081+
</tr>
1082+
<tr>
1083+
<td>RUNNING</td>
1084+
<td>1</td>
1085+
</tr>
1086+
<tr>
1087+
<td>STARTING</td>
1088+
<td>0.5</td>
1089+
</tr>
1090+
<tr>
1091+
<td>STOPPING</td>
1092+
<td>0</td>
1093+
</tr>
1094+
</tbody>
1095+
</table>
1096+
9851097
## Issues and Contributions
9861098
Feel free to express your thoughts about the exporter, unexpected behaviour and\or issues. New feature suggestions are welcome, use [issue tracker](https://github.com/Cinimex-Informatica/mq-java-exporter/issues).
9871099
Pull requests are always welcome.

src/main/java/ru/cinimex/exporter/prometheus/metrics/MetricsReference.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,24 @@ public class MetricsReference {
143143

144144
private static HashMap<Integer, Double> channelStatus = new HashMap<Integer, Double>() {
145145
{
146-
put(MQConstants.MQCHS_BINDING, (double) 6);
147-
put(MQConstants.MQCHS_STARTING, (double) 2);
148146
put(MQConstants.MQCHS_RUNNING, (double) 1);
149-
put(MQConstants.MQCHS_PAUSED, (double) 3);
150-
put(MQConstants.MQCHS_STOPPING, (double) 4);
151-
put(MQConstants.MQCHS_RETRYING, (double) 5);
147+
put(MQConstants.MQCHS_REQUESTING, 0.8);
148+
put(MQConstants.MQCHS_PAUSED, 0.7);
149+
put(MQConstants.MQCHS_BINDING, 0.6);
150+
put(MQConstants.MQCHS_STARTING, 0.5);
151+
put(MQConstants.MQCHS_INITIALIZING, 0.4);
152+
put(MQConstants.MQCHS_SWITCHING, 0.3);
153+
put(MQConstants.MQCHS_STOPPING, 0.2);
154+
put(MQConstants.MQCHS_RETRYING, 0.1);
152155
put(MQConstants.MQCHS_STOPPED, (double) 0);
153-
put(MQConstants.MQCHS_REQUESTING, (double) 7);
154-
put(MQConstants.MQCHS_SWITCHING, (double) 8);
155-
put(MQConstants.MQCHS_INITIALIZING, (double) 9);
156-
put(MQConstants.MQCHS_INACTIVE, (double) 10);
156+
put(MQConstants.MQCHS_INACTIVE, (double) -1);
157157
}
158158
};
159159

160160
private static HashMap<Integer, Double> listenerStatus = new HashMap<Integer, Double>() {
161161
{
162-
put(MQConstants.MQSVC_STATUS_STARTING, (double) 2);
163162
put(MQConstants.MQSVC_STATUS_RUNNING, (double) 1);
163+
put(MQConstants.MQSVC_STATUS_STARTING, 0.5);
164164
put(MQConstants.MQSVC_STATUS_STOPPING, (double) 0);
165165
}
166166
};

src/main/resources/exporter_config.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ prometheusEndpointParams:
1616

1717
# Monitoring objects ----------------------------------
1818

19+
PCFParameters:
20+
sendPCFCommands: true
21+
usePCFWildcards: true
22+
scrapeInterval: 10
23+
1924
queues:
2025
- TEST.QUEUE.1
21-
- TEST.QUEUE.2
26+
- TEST.QUEUE.2
27+
28+
listeners:
29+
- LISTENER01
30+
31+
channels:
32+
- TEST.CHANNEL

0 commit comments

Comments
 (0)