class

JoobQ::ErrorMonitor

Inherits JSON::Serializable / Reference / Object

Error monitoring and alerting system

Constructors

new(pull : JSON::PullParser)
Source
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)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

alert_thresholds
Source
alert_thresholds=(thresholds : Hash(String, Int32))

Setter methods for configuration

Source
clear_old_errors
Source
clear_redis_errors
Source
error_counts
Source
force_reload_from_redis

Force reload data from Redis, bypassing the cache

Source
get_error_stats
Source
get_errors_by_queue(queue_name : String) : Array(ErrorContext)
Source
get_errors_by_type(error_type : String) : Array(ErrorContext)
Source
get_errors_for_jobs_batch(jids : Array(String)) : Hash(String, ErrorContext | Nil)

Get error information for multiple jobs in batch

Source
get_fresh_error_stats

Get fresh error stats by forcing a reload from Redis

Source
get_recent_errors(limit : Int32 = 20) : Array(ErrorContext)
Source
get_recent_errors_count

Get total count of recent errors

Source
get_recent_errors_paginated(page : Int32, per_page : Int32) : Array(ErrorContext)

Get recent errors with pagination support

Source
get_time_windowed_error_stats
Source
load_errors_from_redis
Source
max_recent_errors
Source
max_recent_errors=(max : Int32)
Source
notify_alert
Source
notify_alert=(callback : Proc(Hash(String, String), Nil))
Source
recent_errors
Source
record_error(error_context : ErrorContext) : Nil
Source
reset
Source
store_errors_batch(error_contexts : Array(ErrorContext)) : Nil

Batch error storage for improved performance

Source
time_window
Source
time_window=(window : Time::Span)
Source