Skip to content

Commit

Permalink
* Update to MQ 9.3.2
Browse files Browse the repository at this point in the history
* Add hostname tag for qmgrs running 9.3.2
* Add NativeHA metrics to all collectors
  • Loading branch information
ibmmqmet committed Feb 17, 2023
1 parent c242187 commit c3d53bf
Show file tree
Hide file tree
Showing 50 changed files with 2,069 additions and 258 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
Newest updates are at the top of this file.

### Feb 17 2023 (v5.4.0)
* Update to MQ 9.3.2
* Add hostname tag for qmgrs running 9.3.2
* Add NativeHA metrics to all collectors

### Jan 10 2023 (v5.3.3)
* Copy in metrics.txt summary of available metrics from mq-golang
* JSON exporter - consistent objecttype for qmgr, merge published and
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ARG EXPORTER
ENV EXPORTER=${EXPORTER} \
RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
VRMF=9.3.1.0 \
VRMF=9.3.2.0 \
genmqpkg_incnls=1 \
genmqpkg_incsdk=1 \
genmqpkg_inctls=1 \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin $GOPATH/pkg \
# Location of the downloadable MQ client package \
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
VRMF=9.3.1.0
VRMF=9.3.2.0

# Install the MQ client from the Redistributable package. This also contains the
# header files we need to compile against. Setup the subset of the package
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.run
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apt-get update \
# Location of the downloadable MQ client package \
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
VRMF=9.3.1.0
VRMF=9.3.2.0

# Install the MQ client from the Redistributable package. This also contains the
# header files we need to compile against. Setup the subset of the package
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ only shows channels with a known state and does not report on inactive channels.
To also see the inactive channels, then set the showInactiveChannels
configuration attribute to true.

### NativeHA
When NativeHA is used, the queue manager publishes some metrics on its status. These
are automatically collected whenever available, and can be seen in the metric lists. The metrics
are given a prefix or series of "nha". For example, `ibmmq_nha_synchronous_log_sent_bytes` is one
metric shown in Prometheus. The NativeHA "instance" - the names given to the replicas - is added
as the `nhainstance` tag to the metrics.

Depending on configuration, the collector may be able to automatically reconnect to the new instance
after a failover. If that is not possible, you will need to have a process to restart the collector
once the new replica has taken over.

### z/OS Support
Because the DIS QSTATUS and DIS CHSTATUS commands can be used on z/OS, the monitors
support showing some information from a z/OS queue manager. There is nothing special needed to configure it, beyond the client
Expand Down
2 changes: 1 addition & 1 deletion cmd/mq_aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The example Grafana dashboard shows how queries can be constructed to extract da
about specific queues or the queue manager.

More information on the metrics collected through the publish/subscribe
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.mon.doc/mo00013_.htm)
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/docs/en/ibm-mq/latest?topic=trace-metrics-published-system-topics)
with further description in [an MQDev blog entry](https://community.ibm.com/community/user/integration/viewdocument/statistics-published-to-the-system?CommunityKey=183ec850-4947-49c8-9a2e-8e7c7fc46c64&tab=librarydocuments)

The metrics stored in the database are named after the
Expand Down
12 changes: 12 additions & 0 deletions cmd/mq_aws/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ func Collect() error {
series = "qmgr"
if key == mqmetric.QMgrMapKey {
tags["description"] = mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR)
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}
} else if strings.HasPrefix(key, mqmetric.NativeHAKeyPrefix) {
series = "nha"
tags["nhainstance"] = strings.Replace(key, mqmetric.NativeHAKeyPrefix, "", -1)
} else {
tags["queue"] = key
series = "queue"
Expand Down Expand Up @@ -458,6 +465,11 @@ func Collect() error {
"description": mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR),
}

hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}

f := mqmetric.QueueManagerNormalise(attr, value.ValueInt64)

pt, _ := newPoint(series+"."+attr.MetricName, t, float64(f), tags)
Expand Down
2 changes: 1 addition & 1 deletion cmd/mq_coll/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The example Grafana dashboard shows how queries can be constructed to extract da
about specific queues or the queue manager.

More information on the metrics collected through the publish/subscribe
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.mon.doc/mo00013_.htm)
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/docs/en/ibm-mq/latest?topic=trace-metrics-published-system-topics)
with further description in [an MQDev blog entry](https://community.ibm.com/community/user/integration/viewdocument/statistics-published-to-the-system?CommunityKey=183ec850-4947-49c8-9a2e-8e7c7fc46c64&tab=librarydocuments)

The metrics stored in the database are named after the
Expand Down
12 changes: 11 additions & 1 deletion cmd/mq_coll/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,13 @@ func Collect() error {
series = "qmgr"
if key == mqmetric.QMgrMapKey {
tags["description"] = mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR)

hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}
} else if strings.HasPrefix(key, mqmetric.NativeHAKeyPrefix) {
series = "nha"
tags["nhainstance"] = strings.Replace(key, mqmetric.NativeHAKeyPrefix, "", -1)
} else {
series = "queue"
tags[series] = key
Expand Down Expand Up @@ -372,6 +378,10 @@ func Collect() error {
"platform": platformString,
"description": mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR),
}
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}

f := mqmetric.QueueManagerNormalise(attr, value.ValueInt64)
printPoint(series, attr.MetricName, float32(f), tags)
Expand Down
2 changes: 1 addition & 1 deletion cmd/mq_influx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The example Grafana dashboard shows how queries can be constructed to extract da
about specific objects or the queue manager.

More information on the metrics collected through the publish/subscribe
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.mon.doc/mo00013_.htm)
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/docs/en/ibm-mq/latest?topic=trace-metrics-published-system-topics)
with further description in [an MQDev blog entry](https://community.ibm.com/community/user/integration/viewdocument/statistics-published-to-the-system?CommunityKey=183ec850-4947-49c8-9a2e-8e7c7fc46c64&tab=librarydocuments)

The metrics stored in the Influx database are named after the
Expand Down
12 changes: 12 additions & 0 deletions cmd/mq_influx/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ func Collect(c client.Client) error {
series = "qmgr"
if key == mqmetric.QMgrMapKey {
tags["description"] = mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR)
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}
} else if strings.HasPrefix(key, mqmetric.NativeHAKeyPrefix) {
series = "nha"
tags["nhainstance"] = strings.Replace(key, mqmetric.NativeHAKeyPrefix, "", -1)

} else {
tags["queue"] = key
series = "queue"
Expand Down Expand Up @@ -428,6 +436,10 @@ func Collect(c client.Client) error {
"platform": platformString,
"description": mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR),
}
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}

f := mqmetric.QueueManagerNormalise(attr, value.ValueInt64)
fields := map[string]interface{}{attr.MetricName: f}
Expand Down
2 changes: 1 addition & 1 deletion cmd/mq_json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ means there is no effective limit.
## Metrics
Once the monitor program has been started, you will see metrics being available.
More information on the metrics collected through the publish/subscribe
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.mon.doc/mo00013_.htm)
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/docs/en/ibm-mq/latest?topic=trace-metrics-published-system-topics)
with further description in [an MQDev blog entry](https://community.ibm.com/community/user/integration/viewdocument/statistics-published-to-the-system?CommunityKey=183ec850-4947-49c8-9a2e-8e7c7fc46c64&tab=librarydocuments)

The metrics printed are named after the
Expand Down
16 changes: 14 additions & 2 deletions cmd/mq_json/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ func Collect() error {
pt.Tags["platform"] = platformString
if key == mqmetric.QMgrMapKey {
pt.Tags["description"] = mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR)
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
pt.Tags["hostname"] = hostname
}
} else if strings.HasPrefix(key, mqmetric.NativeHAKeyPrefix) {
pt.Tags["nhainstance"] = strings.Replace(key, mqmetric.NativeHAKeyPrefix, "", -1)
pt.ObjectType = "nha"

} else {
usageString := getUsageString(key)
pt.Tags["queue"] = key
Expand All @@ -259,11 +267,11 @@ func Collect() error {
ptMapPub[key] = pt
}

// Next we extract the info for channel status. Several of the attributes
// are used to build the tags that uniquely identify a channel instance.
// Next we extract the info for object status.
if pollStatus {
ptMap := make(map[string]pointsStruct)

// Several of the attributes are used to build the tags that uniquely identify a channel instance.
for _, attr := range mqmetric.GetObjectStatus("", mqmetric.OT_CHANNEL).Attributes {
for key, value := range attr.Values {
if value.IsInt64 {
Expand Down Expand Up @@ -371,6 +379,10 @@ func Collect() error {
pt.Tags["qmgr"] = strings.TrimSpace(qMgrName)
pt.Tags["platform"] = platformString
pt.Tags["description"] = mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR)
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
pt.Tags["hostname"] = hostname
}
}
}
pt.Metric[fixup(attr.MetricName)] = mqmetric.QueueManagerNormalise(attr, value.ValueInt64)
Expand Down
2 changes: 1 addition & 1 deletion cmd/mq_opentsdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The example Grafana dashboard shows how queries can be constructed to extract da
about specific object or the queue manager.

More information on the metrics collected through the publish/subscribe
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.mon.doc/mo00013_.htm)
interface can be found in the [MQ KnowledgeCenter](https://www.ibm.com/docs/en/ibm-mq/latest?topic=trace-metrics-published-system-topics)
with further description in [an MQDev blog entry](https://community.ibm.com/community/user/integration/viewdocument/statistics-published-to-the-system?CommunityKey=183ec850-4947-49c8-9a2e-8e7c7fc46c64&tab=librarydocuments)

The metrics stored in the database are named after the
Expand Down
11 changes: 11 additions & 0 deletions cmd/mq_opentsdb/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ func Collect() error {
series = "qmgr"
if key == mqmetric.QMgrMapKey {
tags["description"] = mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR)
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}
} else if strings.HasPrefix(key, mqmetric.NativeHAKeyPrefix) {
series = "nha"
tags["nhainstance"] = strings.Replace(key, mqmetric.NativeHAKeyPrefix, "", -1)
} else {
tags["queue"] = key
series = "queue"
Expand Down Expand Up @@ -439,6 +446,10 @@ func Collect() error {
"platform": platformString,
"description": mqmetric.GetObjectDescription("", ibmmq.MQOT_Q_MGR),
}
hostname := mqmetric.GetQueueManagerAttribute(config.cf.QMgrName, ibmmq.MQCACF_HOST_NAME)
if hostname != mqmetric.DUMMY_STRING {
tags["hostname"] = hostname
}

f := mqmetric.QueueManagerNormalise(attr, value.ValueInt64)

Expand Down

0 comments on commit c3d53bf

Please sign in to comment.