class
JoobQ::ErrorMonitor
- JoobQ::ErrorMonitor
- Reference
- Object
Overview
Error monitoring and alerting system
Included Modules
Defined in:
joobq/error_monitor.crConstructors
- .new(pull : JSON::PullParser)
- .new(time_window : Time::Span = 5.minutes, max_recent_errors : Int32 = 100, notify_alert : Proc(Hash(String, String), Nil) = ->(_alert_context : Hash(String, String)) do end)
Instance Method Summary
- #alert_thresholds : Hash(String, Int32)
-
#alert_thresholds=(thresholds : Hash(String, Int32))
Setter methods for configuration
- #clear_old_errors : Nil
- #clear_redis_errors : Nil
- #error_counts : Hash(String, Int32)
-
#force_reload_from_redis : Nil
Force reload data from Redis, bypassing the cache
- #get_error_stats : Hash(String, Int32)
- #get_errors_by_queue(queue_name : String) : Array(ErrorContext)
- #get_errors_by_type(error_type : String) : Array(ErrorContext)
-
#get_errors_for_jobs_batch(jids : Array(String)) : Hash(String, ErrorContext | Nil)
Get error information for multiple jobs in batch
-
#get_fresh_error_stats : Hash(String, Int32)
Get fresh error stats by forcing a reload from Redis
- #get_recent_errors(limit : Int32 = 20) : Array(ErrorContext)
-
#get_recent_errors_count : Int32
Get total count of recent errors
-
#get_recent_errors_paginated(page : Int32, per_page : Int32) : Array(ErrorContext)
Get recent errors with pagination support
- #get_time_windowed_error_stats : Hash(String, Int32)
- #load_errors_from_redis : Nil
- #max_recent_errors : Int32
- #max_recent_errors=(max : Int32)
- #notify_alert : Proc(Hash(String, String), Nil)
- #notify_alert=(callback : Proc(Hash(String, String), Nil))
- #recent_errors : Array(ErrorContext)
- #record_error(error_context : ErrorContext) : Nil
- #reset : Nil
-
#store_errors_batch(error_contexts : Array(ErrorContext)) : Nil
Batch error storage for improved performance
- #time_window : Time::Span
- #time_window=(window : Time::Span)
Constructor Detail
def self.new(time_window : Time::Span = 5.minutes, max_recent_errors : Int32 = 100, notify_alert : Proc(Hash(String, String), Nil) = ->(_alert_context : Hash(String, String)) do
end)
#
Instance Method Detail
def get_errors_for_jobs_batch(jids : Array(String)) : Hash(String, ErrorContext | Nil)
#
Get error information for multiple jobs in batch
def get_fresh_error_stats : Hash(String, Int32)
#
Get fresh error stats by forcing a reload from Redis
def get_recent_errors_paginated(page : Int32, per_page : Int32) : Array(ErrorContext)
#
Get recent errors with pagination support
def store_errors_batch(error_contexts : Array(ErrorContext)) : Nil
#
Batch error storage for improved performance