-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
adds channel metrics #3360
adds channel metrics #3360
Conversation
I haven't written tests yet, I'll write them next week |
Codecov Report
@@ Coverage Diff @@
## master #3360 +/- ##
==========================================
+ Coverage 79.11% 81.07% +1.95%
==========================================
Files 153 10 -143
Lines 7747 354 -7393
Branches 945 32 -913
==========================================
- Hits 6129 287 -5842
+ Misses 1395 60 -1335
+ Partials 223 7 -216 |
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.
Not sure I understand completely. You're collecting a metric for the number of channels, then checking for the status of each of them, and then checking for the status of specified channels in the config ? Why is that ?
@zippolyte The number of channels metric was requested. There aren't really many other metrics for channels that are exposed, so the only other thing we could do is status. We let them set the channels so that we can send a warning if a channel is not there. A channel that exists has only two statuses, on and off. A channel that's not there won't trigger anything when we look for the status automatically. |
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.
Thanks for the explanation. Can you try to factorize a bit the code then ? It feels like a lot of duplication that could be avoided.
Yea I can do that |
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.
Awesome ! Thanks for the inline comments as well 👍
Let's make sure we don't forget to add tests later.
@zippolyte I did add it to the tests! |
ibm_mq/tests/test_ibm_mq.py
Outdated
@@ -69,6 +71,17 @@ def test_check(aggregator, instance, seed_data): | |||
|
|||
aggregator.assert_all_metrics_covered() | |||
|
|||
from six import iteritems | |||
for sc, data in iteritems(aggregator._service_checks): | |||
log.warning("{} {}".format(sc, data)) |
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.
Let's remove those 3 lines
Codecov Report
@@ Coverage Diff @@
## master #3360 +/- ##
==========================================
+ Coverage 79.11% 80.91% +1.79%
==========================================
Files 153 10 -143
Lines 7747 351 -7396
Branches 945 31 -914
==========================================
- Hits 6129 284 -5845
+ Misses 1395 60 -1335
+ Partials 223 7 -216 |
What does this PR do?
This adds channel metrics for IBM MQ
Motivation
customer request
Additional Notes
The number of channels metric was requested. There aren't really many other metrics for channels that are exposed, so the only other thing we could do is status.
We let them set the channels so that we can send a warning if a channel is not there. A channel that exists has only two statuses, on and off. A channel that's not there won't trigger anything when we look for the status automatically.
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached