-
Notifications
You must be signed in to change notification settings - Fork 33
Fix problem getting live metrics when trigger is created with Datasource and Mesagging types (bugzilla 1505343) #88
Conversation
@miq-bot add_label wip, bug |
I don't think @gbaufake this changes are in alert manager |
@aljesusg Since there is no cross-reference between them, I am in favor of merging it after someone reviews it . |
@aljesusg Thanks for the clarifications! |
@aljesusg please have a more informative commit message and description. BZ number is good and needed but some more explanations are needed as well. thanks |
4643fe7
to
341476b
Compare
Did it @abonas !!! Thanks and sorry for the short definition. |
@lucasponce only if you have time, I know you are well familiar with this area |
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.
Code looks good.
As @abonas said, commit message still needs a better description. Stating that data ids were being looked up in the server config rather than in the corresponding subordinated/child entity config should be enough to make easier to understand your changes.
mw_aggregated_rejected_web_sessions | ||
).freeze | ||
MW_WEB_SESSIONS = [ | ||
'mw_aggregated_active_web_sessions', 'WildFly Aggregated Web Metrics~Aggregated Active Web Sessions', |
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.
I'm not sure of this.
Native metric names should be in the configuration file loaded, and in theory it shouldn't be manipulated here.
In the next iteration hMetrics will change to a Prometheus and this names will be completely different.
So, it should not hit the MiQ code.
I guess that in there was a utility class to fetch the native metric from the miq name that could be used.
Or perhaps I am missing something.
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.
I need it for test that method is getting the right definition because this was the problem that I have. How could I solve it?
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 mixing should load this info from the config files
https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/live_metrics_mixin.rb
so, it should be available at resource level AFAIR
dfa6439
to
dbba2a1
Compare
@miq-bot remove_label wip |
@lucasponce I remove the native metrics name with another tests, now I think is fine. |
Can you review this or merge if it's ok? |
It looks good. |
It isn't Lucas, the alert profile is defined to assign to a MiddlewareServer no to a MiddlewareDataSource. Do MiddlewareDatasource and MiddlewareMesagging depends of MiddlewareServer? |
In theory, the MiddlewareServer can be seen as the parent resource of MiddlewareDatasource or MiddlewareMessaging objects. |
Ok, maybe we should analyze this because could be another requirement for UI. @abonas What do you think? |
sure, but this is @jdoyleoss decision |
I think there is some gap here. |
@lucasponce I agree. we need clarifications here. just to recap, the definition of the enhancement was (this is only the first part of the definition, the rest is in JIRA) |
I think that we can merge this If looks good for you. Now Datasource alerts apply to all datasources that they are in the Middleware Server where you assigned the alert profile, maybe we can do a feature to select which Datasources you wanna have this alert. |
if from @lucasponce perspective this is good to be merge, I'll merge it. I'm not familiar well with this area myself. |
I'm reading some differences in the Jira tasks. JMAN4-201 just lists the metrics. HAWKULAR-1255 clearly state the base entities. Apart from that, @lucasponce concenrs are true. Remember that "alerts" are templates for Hawkular. So, even if something is correctly created in Hawkular, that's an unbounded trigger. The bounding is done in the profile and, if I'm not wrong, the code (as it is right now) will bound the datasource and messaging alerts to the wrong metric ids. So, those alerts won't work. I think it's OK to merge, but there is still some work to have datasources and messagings alerts working correctly. |
As @israel-hdez comments, an MiQ Alert creates a Hawkular Group Trigger, which works like a template. |
dbba2a1
to
f58fb2c
Compare
Checked commit aljesusg@f58fb2c with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
@miq-bot add_label gaprindashvili/yes |
Fix problem getting live metrics when trigger is created with Datasource and Mesagging types (bugzilla 1505343) (cherry picked from commit 9d45bf3)
Gaprindashvili backport details:
|
When alerts type Datasource and Mesagging are create in hawkular conditions and dataID is nil, the problem is getting the livemetrics of these kinds of alerts.
Fix Alerts of https://bugzilla.redhat.com/show_bug.cgi?id=1505343