Skip to content
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

Remove unwanted Application Events from Timeline #13669

Merged
merged 1 commit into from
Jan 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/ems_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def get_target(target_type)

target_type = "src_vm_or_template" if target_type == "src_vm"
target_type = "dest_vm_or_template" if target_type == "dest_vm"
target_type = "middleware_server" if event.event_type == "hawkular_event"
target_type = "middleware_server" if event.event_type == "hawkular_alert"

event.send(target_type)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def convert_to_group_trigger(miq_alert)
'firingMatch' => firing_match,
'context' => context,
'tags' => {
'miq.event_type' => 'hawkular_event',
'miq.event_type' => 'hawkular_alert',
'miq.resource_type' => miq_alert[:based_on]
})
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def initialize(cfg = {})
'hawkular_datasource_remove.ok',
'hawkular_deployment.ok',
'hawkular_deployment_remove.ok',
'hawkular_event' # # general purpose detail level event
'hawkular_event', # general purpose detail level event
# filtered (not shown in timeline)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jshaughn - if I understand the purpose of this PR correctly, it looks like the relevant event_type is now 'hawkular_alert' and no longer 'hawkular_event'. If that is the case, should 'hawkular event' be deleted from the white list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bronaghs Good question but no, we need both. The issue was that the 'hawkular_event' event_type was being used both by the alerts mechanism (for internal use) and for legitimate events to be shown on the timeline. With this change the 'hawkular_alert' event_type will now be used exclusively for alerting, and not shown on the timeline, leaving the valid 'hawkular_event' events to be shown.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification @jshaughn

'hawkular_alert'
].to_set.freeze
end

Expand Down
8 changes: 4 additions & 4 deletions app/models/miq_alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -425,17 +425,17 @@ def self.automate_expressions
}},
{:name => :operator, :description => _("Operator"), :values => ["Changed"]}
]},
{:name => "mw_heap_used", :description => _("JVM Heap Used"), :db => ["MiddlewareServer"], :responds_to_events => "hawkular_event",
{:name => "mw_heap_used", :description => _("JVM Heap Used"), :db => ["MiddlewareServer"], :responds_to_events => "hawkular_alert",
:options => [
{:name => :value_mw_greater_than, :description => _("> Heap Max (%)"), :numeric => true},
{:name => :value_mw_less_than, :description => _("< Heap Max (%)"), :numeric => true}
]},
{:name => "mw_non_heap_used", :description => _("JVM Non Heap Used"), :db => ["MiddlewareServer"], :responds_to_events => "hawkular_event",
{:name => "mw_non_heap_used", :description => _("JVM Non Heap Used"), :db => ["MiddlewareServer"], :responds_to_events => "hawkular_alert",
:options => [
{:name => :value_mw_greater_than, :description => _("> Non Heap Committed (%)"), :numeric => true},
{:name => :value_mw_less_than, :description => _("< Non Heap Committed (%)"), :numeric => true}
]},
{:name => "mw_accumulated_gc_duration", :description => _("JVM Accumulated GC Duration"), :db => ["MiddlewareServer"], :responds_to_events => "hawkular_event",
{:name => "mw_accumulated_gc_duration", :description => _("JVM Accumulated GC Duration"), :db => ["MiddlewareServer"], :responds_to_events => "hawkular_alert",
:options => [
{:name => :mw_operator, :description => _("Operator"), :values => [">", ">=", "<", "<=", "="]},
{:name => :value_mw_garbage_collector, :description => _("Duration Per Minute (ms)"), :numeric => true}
Expand Down Expand Up @@ -501,7 +501,7 @@ def self.expression_by_name(name)

def self.raw_events
@raw_events ||= expression_by_name("event_threshold")[:options].find { |h| h[:name] == :event_types }[:values] +
['hawkular_event']
['hawkular_alert']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that @moolitayer was also interested on this.
This is just a renaming to only show desired events on ManageIQ.
I think this would not impact on the Datawarehouse provider, but just in case if you want to take a look as well.

end

def self.event_alertable?(event)
Expand Down