Skip to content

Commit 0caec3d

Browse files
authored
Bugfix/issue78 82 83 84 85 86 87 metrics names fixes (#100)
* Changed metric names * Revert "Changed metric names" This reverts commit 4940421. * Changed metric names, unit description
1 parent cb6c834 commit 0caec3d

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ This section provides a description of domains and subdomains and reflects their
333333
</tr>
334334
</tbody>
335335
</table>
336-
336+
337337
#### Units
338338
<sub><sup> [Back to TOC.](#table-of-contents) </sup></sub><br/>
339339
This section provides a description of metric units.<br/>
@@ -351,7 +351,7 @@ This section provides a description of metric units.<br/>
351351
</tr>
352352
<tr>
353353
<td>hundredths</td>
354-
<td>Shows amount of hundredths. For example, "370 hundredths equal" to "3.70". It is used to reflect system's load average.</td>
354+
<td>Shows amount of hundredths. For example, "370 hundredths" equals to "3.70". It is used to reflect system's load average and LISTENER\CHANNEL status codes.</td>
355355
</tr>
356356
<tr>
357357
<td>megabytes</td>
@@ -484,7 +484,7 @@ This section provides a description of CPU metrics of a running queue manager.
484484
<td>User CPU time - percentage estimate for queue manager</td>
485485
</tr>
486486
<tr>
487-
<td>mq_cpu_system_cpu_time_estimat_percentage</td>
487+
<td>mq_cpu_system_cpu_time_estimate_percentage</td>
488488
<td>gauge</td>
489489
<td>Estimates the percentage of CPU use in system state for processes that are related to the queue managers that are being monitored</td>
490490
<td>System CPU time - percentage estimate for queue manager</td>
@@ -650,7 +650,7 @@ This section provides a description of metrics related to MQCONN and MQDISC call
650650
<td>Failed MQCONN/MQCONNX count</td>
651651
</tr>
652652
<tr>
653-
<td>mq_mqconn_concurrent_connections_high_water_mark_totalconnections</td>
653+
<td>mq_mqconn_concurrent_connections_high_water_mark_connections</td>
654654
<td>gauge</td>
655655
<td>Shows the maximum number of concurrent connections in the current statistics interval.</td>
656656
<td>Concurrent connections - high water mark</td>
@@ -800,13 +800,13 @@ This section provides a description of metrics related to MQPUT, MQPUT1 and MQST
800800
<td>Failed MQPUT1 count</td>
801801
</tr>
802802
<tr>
803-
<td>mq_put_put_non_persistent_messages_byte_count_totalmessages</td>
803+
<td>mq_put_put_non_persistent_messages_byte_count_totalbytes</td>
804804
<td>counter</td>
805805
<td>Shows the number of bytes put in non-persistent messages.</td>
806806
<td>Put non-persistent messages - byte count</td>
807807
</tr>
808808
<tr>
809-
<td>mq_put_put_persistent_messages_byte_count_totalmessages</td>
809+
<td>mq_put_put_persistent_messages_byte_count_totalbytes</td>
810810
<td>counter</td>
811811
<td>Shows the number of bytes put in persistent messages.</td>
812812
<td>Put persistent messages - byte count</td>
@@ -911,7 +911,7 @@ This section provides a description of metrics related to MQGET, MQCB and MQCTL
911911
<td>Expired message count</td>
912912
</tr>
913913
<tr>
914-
<td>mq_get_purged_queue_count_totalmessages</td>
914+
<td>mq_queue_purged_queue_count_totalqueues</td>
915915
<td>counter</td>
916916
<td>Shows a count of queues that have been purged.</td>
917917
<td>Purged queue count</td>
@@ -1093,7 +1093,7 @@ This section provides a description of metrics related to publications of a que
10931093
<td>Published to subscribers - message count</td>
10941094
</tr>
10951095
<tr>
1096-
<td>mq_publish_published_to_subscribers_byte_count_totalmessages</td>
1096+
<td>mq_publish_published_to_subscribers_byte_count_totalbytes</td>
10971097
<td>counter</td>
10981098
<td>Shows the byte count of messages that are published to subscribers.</td>
10991099
<td>Published to subscribers - byte count</td>
@@ -1366,12 +1366,12 @@ This section provides a description of metrics of queues, channels and listeners
13661366
<td>Shows maximum number of messages that are allowed on the queue.</td>
13671367
</tr>
13681368
<tr>
1369-
<td>mqobject_channel_channel_status_code</td>
1369+
<td>mqobject_channel_channel_status_hundredths</td>
13701370
<td>gauge</td>
13711371
<td>Shows current channel status. Mapping of channel statuses to prometheus metric values can be found <a href="#channel-status-mapping">here</a>.</td>
13721372
</tr>
13731373
<tr>
1374-
<td>mqobject_listener_listener_status_code</td>
1374+
<td>mqobject_listener_listener_status_hundredths</td>
13751375
<td>gauge</td>
13761376
<td>Shows current listener status. Mapping of listener statuses to prometheus metric values can be found <a href="#listener-status-mapping">here</a>.</td>
13771377
</tr>
@@ -1390,47 +1390,47 @@ This section provides a mapping between MQ channel statuses and metric values, t
13901390
</tr>
13911391
<tr>
13921392
<td>RUNNING</td>
1393-
<td>1</td>
1393+
<td>100</td>
13941394
</tr>
13951395
<tr>
13961396
<td>REQUESTING</td>
1397-
<td>0.8</td>
1397+
<td>90</td>
13981398
</tr>
13991399
<tr>
14001400
<td>PAUSED</td>
1401-
<td>0.7</td>
1401+
<td>80</td>
14021402
</tr>
14031403
<tr>
14041404
<td>BINDING</td>
1405-
<td>0.6</td>
1405+
<td>70</td>
14061406
</tr>
14071407
<tr>
14081408
<td>STARTING</td>
1409-
<td>0.5</td>
1409+
<td>60</td>
14101410
</tr>
14111411
<tr>
14121412
<td>INITIALIZING</td>
1413-
<td>0.4</td>
1413+
<td>50</td>
14141414
</tr>
14151415
<tr>
14161416
<td>SWITCHING</td>
1417-
<td>0.3</td>
1417+
<td>40</td>
14181418
</tr>
14191419
<tr>
14201420
<td>STOPPING</td>
1421-
<td>0.2</td>
1421+
<td>30</td>
14221422
</tr>
14231423
<tr>
14241424
<td>RETRYING</td>
1425-
<td>0.1</td>
1425+
<td>20</td>
14261426
</tr>
14271427
<tr>
14281428
<td>STOPPED</td>
1429-
<td>0</td>
1429+
<td>10</td>
14301430
</tr>
14311431
<tr>
14321432
<td>INACTIVE</td>
1433-
<td>-1</td>
1433+
<td>0</td>
14341434
</tr>
14351435
</tbody>
14361436
</table>
@@ -1448,15 +1448,15 @@ This section provides a mapping between MQ listener statuses and metric values,
14481448
</tr>
14491449
<tr>
14501450
<td>RUNNING</td>
1451-
<td>1</td>
1451+
<td>100</td>
14521452
</tr>
14531453
<tr>
14541454
<td>STARTING</td>
1455-
<td>0.75</td>
1455+
<td>75</td>
14561456
</tr>
14571457
<tr>
14581458
<td>STOPPING</td>
1459-
<td>0.5</td>
1459+
<td>50</td>
14601460
</tr>
14611461
<tr>
14621462
<td>STOPPED</td>

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
3434
metrics.put("RAM free percentage", new Metric("system_ram_ram_free_percentage", Metric.Type.SIMPLE_GAUGE));
3535
metrics.put("RAM total bytes", new Metric("system_ram_ram_total_megabytes", Metric.Type.SIMPLE_GAUGE));
3636
metrics.put("User CPU time - percentage estimate for queue manager", new Metric("mq_cpu_user_cpu_time_estimate_percentage", Metric.Type.SIMPLE_GAUGE));
37-
metrics.put("System CPU time - percentage estimate for queue manager", new Metric("mq_cpu_system_cpu_time_estimat_percentage", Metric.Type.SIMPLE_GAUGE));
37+
metrics.put("System CPU time - percentage estimate for queue manager", new Metric("mq_cpu_system_cpu_time_estimate_percentage", Metric.Type.SIMPLE_GAUGE));
3838
metrics.put("RAM total bytes - estimate for queue manager", new Metric("mq_ram_ram_total_estimate_megabytes", Metric.Type.SIMPLE_GAUGE));
3939
metrics.put("MQ trace file system - bytes in use", new Metric("system_disk_trace_file_system_in_use_megabytes", Metric.Type.SIMPLE_GAUGE));
4040
metrics.put("MQ trace file system - free space", new Metric("system_disk_trace_file_system_free_space_percentage", Metric.Type.SIMPLE_GAUGE));
@@ -52,7 +52,7 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
5252
metrics.put("Log - write latency", new Metric("mq_rlog_log_write_latency_microseconds", Metric.Type.SIMPLE_GAUGE));
5353
metrics.put("MQCONN/MQCONNX count", new Metric("mq_mqconn_mqconnx_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
5454
metrics.put("Failed MQCONN/MQCONNX count", new Metric("mq_mqconn_failed_mqconn_mqconnx_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
55-
metrics.put("Concurrent connections - high water mark", new Metric("mq_mqconn_concurrent_connections_high_water_mark_totalconnections", Metric.Type.SIMPLE_GAUGE));
55+
metrics.put("Concurrent connections - high water mark", new Metric("mq_mqconn_concurrent_connections_high_water_mark_connections", Metric.Type.SIMPLE_GAUGE));
5656
metrics.put("MQDISC count", new Metric("mq_mqdisc_mqdisc_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
5757
metrics.put("MQOPEN count", new Metric("mq_mqopen_mqopen_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
5858
metrics.put("Failed MQOPEN count", new Metric("mq_mqopen_failed_mqopen_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
@@ -70,8 +70,8 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
7070
metrics.put("Non-persistent message MQPUT1 count", new Metric("mq_put_non_persistent_message_mqput1_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
7171
metrics.put("Persistent message MQPUT1 count", new Metric("mq_put_persistent_message_mqput1_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
7272
metrics.put("Failed MQPUT1 count", new Metric("mq_put_failed_mqput1_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
73-
metrics.put("Put non-persistent messages - byte count", new Metric("mq_put_put_non_persistent_messages_byte_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
74-
metrics.put("Put persistent messages - byte count", new Metric("mq_put_put_persistent_messages_byte_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
73+
metrics.put("Put non-persistent messages - byte count", new Metric("mq_put_put_non_persistent_messages_byte_count_totalbytes", Metric.Type.SIMPLE_COUNTER));
74+
metrics.put("Put persistent messages - byte count", new Metric("mq_put_put_persistent_messages_byte_count_totalbytes", Metric.Type.SIMPLE_COUNTER));
7575
metrics.put("MQSTAT count", new Metric("mq_put_mqstat_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
7676
metrics.put("Interval total destructive get- count", new Metric("mq_get_interval_total_destructive_get_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
7777
metrics.put("Interval total destructive get - byte count", new Metric("mq_get_interval_total_destructive_get_byte_count_totalbytes", Metric.Type.SIMPLE_COUNTER));
@@ -86,7 +86,7 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
8686
metrics.put("Non-persistent message browse - byte count", new Metric("mq_get_non_persistent_message_browse_byte_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
8787
metrics.put("Persistent message browse - byte count", new Metric("mq_get_persistent_message_browse_byte_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
8888
metrics.put("Expired message count", new Metric("mq_get_expired_message_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
89-
metrics.put("Purged queue count", new Metric("mq_get_purged_queue_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
89+
metrics.put("Purged queue count", new Metric("mq_queue_purged_queue_count_totalqueues", Metric.Type.SIMPLE_COUNTER));
9090
metrics.put("MQCB count", new Metric("mq_get_mqcb_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
9191
metrics.put("Failed MQCB count", new Metric("mq_get_failed_mqcb_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
9292
metrics.put("MQCTL count", new Metric("mq_get_mqctl_count_totalcalls", Metric.Type.SIMPLE_COUNTER));
@@ -109,7 +109,7 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
109109
metrics.put("Topic MQPUT/MQPUT1 interval total", new Metric("mq_publish_topic_mqput_mqput1_interval_total_totalmessages", Metric.Type.SIMPLE_COUNTER));
110110
metrics.put("Interval total topic bytes put", new Metric("mq_publish_interval_total_topic_bytes_put_totalbytes", Metric.Type.SIMPLE_COUNTER));
111111
metrics.put("Published to subscribers - message count", new Metric("mq_publish_published_to_subscribers_message_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
112-
metrics.put("Published to subscribers - byte count", new Metric("mq_publish_published_to_subscribers_byte_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
112+
metrics.put("Published to subscribers - byte count", new Metric("mq_publish_published_to_subscribers_byte_count_totalbytes", Metric.Type.SIMPLE_COUNTER));
113113
metrics.put("Non-persistent - topic MQPUT/MQPUT1 count", new Metric("mq_publish_non_persistent_topic_mqput_mqput1_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
114114
metrics.put("Persistent - topic MQPUT/MQPUT1 count", new Metric("mq_publish_persistent_topic_mqput_mqput1_count_totalmessages", Metric.Type.SIMPLE_COUNTER));
115115
metrics.put("Failed topic MQPUT/MQPUT1 count", new Metric("mq_publish_failed_topic_mqput_mqput1_count_totalattempts", Metric.Type.SIMPLE_COUNTER));
@@ -124,8 +124,8 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
124124
private static EnumMap<MQObject.MQType, AdditionalMetric> getMqObjectAdditionalMetricsReference() {
125125
EnumMap<MQObject.MQType, AdditionalMetric> metrics = new EnumMap<>(MQObject.MQType.class);
126126
metrics.put(MQObject.MQType.QUEUE, new AdditionalMetric("mqobject_queue_queue_max_depth_messages", "The maximum number of messages that are allowed on the queue"));
127-
metrics.put(MQObject.MQType.CHANNEL, new AdditionalMetric("mqobject_channel_channel_status_code", "The status of the channel"));
128-
metrics.put(MQObject.MQType.LISTENER, new AdditionalMetric("mqobject_listener_listener_status_code", "The status of the listener"));
127+
metrics.put(MQObject.MQType.CHANNEL, new AdditionalMetric("mqobject_channel_channel_status_hundredths", "The status of the channel"));
128+
metrics.put(MQObject.MQType.LISTENER, new AdditionalMetric("mqobject_listener_listener_status_hundredths", "The status of the listener"));
129129
return metrics;
130130
}
131131

@@ -175,17 +175,17 @@ private static HashMap<String, Metric> getMqObjectMetricsReference() {
175175
*/
176176
private static HashMap<Integer, Double> getChannelStatuses() {
177177
HashMap<Integer, Double> statuses = new HashMap<>();
178-
statuses.put(MQConstants.MQCHS_RUNNING, (double) 1);
179-
statuses.put(MQConstants.MQCHS_REQUESTING, 0.8);
180-
statuses.put(MQConstants.MQCHS_PAUSED, 0.7);
181-
statuses.put(MQConstants.MQCHS_BINDING, 0.6);
182-
statuses.put(MQConstants.MQCHS_STARTING, 0.5);
183-
statuses.put(MQConstants.MQCHS_INITIALIZING, 0.4);
184-
statuses.put(MQConstants.MQCHS_SWITCHING, 0.3);
185-
statuses.put(MQConstants.MQCHS_STOPPING, 0.2);
186-
statuses.put(MQConstants.MQCHS_RETRYING, 0.1);
187-
statuses.put(MQConstants.MQCHS_STOPPED, (double) 0);
188-
statuses.put(MQConstants.MQCHS_INACTIVE, (double) -1);
178+
statuses.put(MQConstants.MQCHS_RUNNING, 100d);
179+
statuses.put(MQConstants.MQCHS_REQUESTING, 90d);
180+
statuses.put(MQConstants.MQCHS_PAUSED, 80d);
181+
statuses.put(MQConstants.MQCHS_BINDING, 70d);
182+
statuses.put(MQConstants.MQCHS_STARTING, 60d);
183+
statuses.put(MQConstants.MQCHS_INITIALIZING, 50d);
184+
statuses.put(MQConstants.MQCHS_SWITCHING, 40d);
185+
statuses.put(MQConstants.MQCHS_STOPPING, 30d);
186+
statuses.put(MQConstants.MQCHS_RETRYING, 20d);
187+
statuses.put(MQConstants.MQCHS_STOPPED, 10d);
188+
statuses.put(MQConstants.MQCHS_INACTIVE, 0d);
189189
return statuses;
190190
}
191191

@@ -196,10 +196,10 @@ private static HashMap<Integer, Double> getChannelStatuses() {
196196
*/
197197
private static HashMap<Integer, Double> getListenerStatuses() {
198198
HashMap<Integer, Double> statuses = new HashMap<>();
199-
statuses.put(MQConstants.MQSVC_STATUS_RUNNING, 1.0);
200-
statuses.put(MQConstants.MQSVC_STATUS_STARTING, 0.75);
201-
statuses.put(MQConstants.MQSVC_STATUS_STOPPING, 0.5);
202-
statuses.put(MQConstants.MQSVC_STATUS_STOPPED, 0.0);
199+
statuses.put(MQConstants.MQSVC_STATUS_RUNNING, 100d);
200+
statuses.put(MQConstants.MQSVC_STATUS_STARTING, 75d);
201+
statuses.put(MQConstants.MQSVC_STATUS_STOPPING, 50d);
202+
statuses.put(MQConstants.MQSVC_STATUS_STOPPED, 0d);
203203
return statuses;
204204
}
205205

0 commit comments

Comments
 (0)