Skip to content

Conversation

dol
Copy link
Contributor

@dol dol commented Apr 8, 2025

Adds new filters.showCustomAttribute config setting to add the CUSTOM attribute data from a queue manager or queue as metrics tag/label.

Please ensure all items are complete before opening.

What

We have the requirement to annotate queue manager and queue metrics with a custom tag or label. This information helps query the metrics based on this custom label and create alerts based on this information.
The CUSTOM attribute on queue manager and queue level can be utilized for this kind of additional information. As an IBM MQ platform team we will set CUSTOM("APP(A0123)") on a queue manager or on a queue. The new capability in this PR extracts this CUSTOM data and adds it as a tag or label depending on the collector.

How

The query request of the queue manager and queue attributes was extended to include the ibmmq.MQCA_CUSTOM data.

Testing

The change was tested locally for otel, prometheus and JSON exporter.

Issues

Open point

  1. The changes to [mq-golang](https://github.com/ibm-messaging/mq-golang) were commited to the vendor folder as it's not clear how to bring the changes upstream. Should a pull request opened at mq-golang?
  2. Since I don't have any expirience with IBM MQ for z/OS I'm not sure if the custom attribute is supported in that platform. For that reason the showAndSupportsCustomLabel method was created to mark it false if the platform does not support it.

…STOM attribute as tag/label

Adds new `filters.showCustomAttribute` config setting to add the CUSTOM
attribute data from a queue manager or queue as metrics tag/label.
@dol
Copy link
Contributor Author

dol commented Aug 11, 2025

@ibmmqmet It would be nice if you could review and add it to the project.

@ibmmqmet
Copy link
Collaborator

ibmmqmet commented Aug 14, 2025

I somehow missed this when first opened. But a few comments:

  • The CUSTOM attribute is documented as reserved for IBM use. While I don't see it ever getting used again in future, because of changes to how new function is delivered, it really should not be considered a general-purpose user interface.
  • The DESCR field (and the qmgr-wide metadata tags that can be configured in these collectors) do cover a lot of uses
  • Changes to the mqmetric library would have to be done via a PR to the mq-golang repo first, and then released before they could be exploited by actual collectors. Though I could copy things piecemeal into my local repos so they could be released at the same-ish time
  • CUSTOM is available for z/OS qmgrs and has been used, though again I doubt it will be used in future

I think I need to discuss locally whether or not any unintended use of CUSTOM should be condoned before deciding what to do about this.

Having said that, at least this PR looks to be well-written and follow a reasonable model.

@ibmmqmet
Copy link
Collaborator

ibmmqmet commented Oct 7, 2025

We've agreed that this kind of use of CUSTOM is going to be OK (and will get into the docs at some point). So this PR will get merged for the next release - likely to be alongside the next MQ CD version.

Thanks for providing such a clean merge! I had to move the vendor tree changes across for the other repo, but apart from that it went in to my systems quite easily.

ibmmqmet added a commit to ibm-messaging/mq-golang that referenced this pull request Oct 16, 2025
ibmmqmet added a commit to ibm-messaging/mq-golang that referenced this pull request Oct 16, 2025
- mqmetric - Make command requests (and replies) expire after a while
- mqmetric - Add option to add CUSTOM attribute to qmgr/queue tags (ibm-messaging/mq-metric-samples#392)
@ibmmqmet ibmmqmet merged commit 1b39874 into ibm-messaging:master Oct 16, 2025
@dol
Copy link
Contributor Author

dol commented Oct 16, 2025

Thank you for reviewing and merging. This is a huge leap forward for us as we don't need to operate and maintain or own fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants