Class: RailsErrorDashboard::Plugins::MetricsPlugin
Overview
Instance Method Summary
collapse
#enabled?, #on_error_viewed, #on_register, #safe_execute
Instance Method Details
#description ⇒ Object
18
19
20
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 18
def description
"Tracks error metrics and sends to monitoring service"
end
|
#name ⇒ Object
14
15
16
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 14
def name
"Metrics Tracker"
end
|
#on_error_logged(error_log) ⇒ Object
26
27
28
29
30
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 26
def on_error_logged(error_log)
increment_counter("errors.new", error_log)
increment_counter("errors.by_type.#{sanitize_metric_name(error_log.error_type)}", error_log)
increment_counter("errors.by_platform.#{error_log.platform || 'unknown'}", error_log)
end
|
#on_error_recurred(error_log) ⇒ Object
32
33
34
35
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 32
def on_error_recurred(error_log)
increment_counter("errors.recurred", error_log)
increment_counter("errors.occurrence.#{error_log.id}", error_log)
end
|
#on_error_resolved(error_log) ⇒ Object
37
38
39
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 37
def on_error_resolved(error_log)
increment_counter("errors.resolved", error_log)
end
|
#on_errors_batch_deleted(error_ids) ⇒ Object
45
46
47
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 45
def on_errors_batch_deleted(error_ids)
increment_counter("errors.batch_deleted", count: error_ids.size)
end
|
#on_errors_batch_resolved(error_logs) ⇒ Object
41
42
43
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 41
def on_errors_batch_resolved(error_logs)
increment_counter("errors.batch_resolved", count: error_logs.size)
end
|
#version ⇒ Object
22
23
24
|
# File 'lib/rails_error_dashboard/plugins/metrics_plugin.rb', line 22
def version
"1.0.0"
end
|