-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add metric ibm_mq.channel.conns to ibm mq integration, add channel and connection metric tests #20519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
8fe0745
to
290b3e5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
- Update channel metric collector to use channel_status_metrics() instead of channel_metrics() for discovered channels to properly collect buffers_rcvd metric - Update test assertions to match actual tags being sent in gauge calls - Fix unit tests in test_channel_metric_collector.py to pass This change ensures that channel status metrics like buffers_rcvd are properly collected and reported by the integration.
- Updated get_pcf_channel_metrics to submit configuration metrics instead of status metrics. - Modified unit tests to verify that configuration metrics are collected for channels with empty or no connections. - Added a new test test_channel_status_metrics to ensure status metrics and connection metrics are correctly submitted.
connection_name = to_string(channel_info[pymqi_type]).strip() | ||
if not connection_name: | ||
continue | ||
connection_tags = tags + ["connection:{}".format(connection_name)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The connection tag, is there any chance it can be unbounded? Or what does a connection look like?
ibm_mq.channel.bytes_sent,gauge,,byte,,This attribute specifies the number of bytes sent (parameter identifier: `MQIACH_BYTES_SENT`).,0,ibm_mq,bytes sent,, | ||
ibm_mq.channel.channel_status,gauge,,,,This attribute specifies the channel status (parameter identifier: `MQIACH_CHANNEL_STATUS`).,0,ibm_mq,channel status,, | ||
ibm_mq.channel.channels,gauge,,resource,,The number of active channels.,0,ibm_mq,active channel count,, | ||
ibm_mq.channel.conns,gauge,,connection,,The number of connections to the channel (parameter identifier: `MQIACH_CONNS`).,0,ibm_mq,conns,, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems more like a con.status metric to me. Each connection will have a status and report 1 as a gauge, rather than a sum of the conns.
What does this PR do?
This PR adds a new metric
ibm_mq.channel.conns
to the IBM MQ integration. This metric is a gauge that indicates active connections per channel, with a value of 1 for each active connection. It is tagged with both the channel name and connection information, allowing users to monitor which specific connections are active for each channel.Additionally, this PR significantly enhances the test coverage for channel and connection metrics by:
Proper tagging of connection metrics
Motivation
The motivation behind this PR is to enhance the monitoring capabilities of the IBM MQ integration by providing visibility into active connections per channel. This feature allows users to track connection changes over time and identify which connections are active, which is crucial for maintaining the health and performance of the messaging system.
This was requested in escalation AGENT-13489/FRAGENT-3166 by customer Broadridge (GTO) (org ID: 345886).
Manual QA Steps
Ubu-ddev-docker
(required for the correct architecture)pytest tests/test_ibm_mq_unit.py -v
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged