Repository navigation
Conversation
ce8f266 to
d524b67
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Queue metrics collection is blocked by invalid MQ inquiries that add multiple FilterCommands and apply a list-exclusion operator to scalar queue names.
2 open issues
What changed in this PR
This PR aims to reduce IBM MQ queue-query results by sending configured exclusions in PCF requests, rather than relying solely on response-side filtering.
Changes:
- Adds exclusion parameters to
MQCMD_INQUIRE_Qrequests. - Translates configured match types into operators and wildcard patterns, while retaining existing client-side filtering.
| File | Description |
|---|---|
ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metricscollector/InquireQCmdCollector.java |
Builds PCF queue-name filters from configured exclusions. |
Review effort: Balanced
| for (ExcludeFilters filter : context.getQueueExcludeFilters()) { | ||
| for (String value : filter.getValues()) { |
…/InquireQCmdCollector.java
d524b67 to
c5a4201
Compare
|
|
||
| // take the first filter, and apply it, as we can only apply one filter. | ||
| if (!context.getQueueExcludeFilters().isEmpty()) { | ||
| ExcludeFilters filter = context.getQueueExcludeFilters().iterator().next(); |
There was a problem hiding this comment.
Since you have changed this to a list and area already checking non-empty, you shouldn't be using an iterator here. You can just do context.getQueueExcludeFilters().get(0).
| request.addParameter(CMQC.MQCA_Q_NAME, queueGenericName); | ||
| request.addParameter(CMQC.MQIA_Q_TYPE, CMQC.MQQT_ALL); | ||
|
|
||
| // take the first filter, and apply it, as we can only apply one filter. |
There was a problem hiding this comment.
This seems goofy -- why can we only apply one? The addFilterParameter() method is where the rubber meets the road, and that name suggests you can call it once. Then again, who knows how IBM designed this madness.
Is there a reference somewhere that indicates only one filter?
breedx-splk
left a comment
There was a problem hiding this comment.
This PR is missing some tests, especially around the InquireQCmdCollector changes.

Description:
We currently send a PCF message with our inclusion pattern, and exclude after the fact based on results. It appears MQ can also take an exclusion filter as an additional parameter to the PCF message.