Heartfly

Monitor Background Worker Queue Processors

Ensure your application's critical background tasks are always processed by monitoring queue workers. Get alerted instantly if a worker stops pulling from the queue, preventing stalled jobs and performance issues.

The problem

Many modern applications rely on background workers and message queues (like Redis with Sidekiq or RabbitMQ with Celery) to offload critical, time-consuming tasks. If a worker process silently crashes, hangs, or stops consuming messages from its queue, critical jobs pile up unprocessed. This leads to degraded application performance, delayed customer actions (e.g., report generation, image processing), and a severe impact on user experience, often unnoticed until a backlog becomes enormous.

Imagine a Sidekiq worker responsible for processing customer-uploaded images, generating thumbnails, and storing them on S3. If this worker silently stops due to a memory leak or an unhandled exception, new images won't be processed. Users attempting to view their galleries will see broken images, and the queue will grow indefinitely. Developers typically discover this only after customers report issues or manual inspection of the queue size, by which time the backlog is significant and difficult to clear.

How Heartfly solves it

1
Integrate a Heartfly ping at the end of each batch of processed jobs or periodically within long-running workers.
2
Receive immediate alerts when your background workers fail to report, preventing queue build-ups and stalled tasks.
3
Ensure the continuous processing of critical background jobs, maintaining application reliability and performance.

Concrete example

# Example using Sidekiq middleware or directly in a worker
class HeartflyMiddleware
  def call(worker, msg, queue)
    yield
    # Ping Heartfly after successful job execution
    Net::HTTP.get(URI.parse(ENV['HEARTFLY_PING_URL_WORKER']))
  rescue StandardError => e
    Rails.logger.error "Heartfly ping failed: #{e.message}"
    raise # Re-raise original error
  end
end
# Or, in a periodic batch processing script:
# Net::HTTP.get(URI.parse(ENV['HEARTFLY_PING_URL_BATCH_WORKER']))

Ready to try Heartfly?

Get pinged when your cron jobs go silent.

Frequently asked questions

How does Heartfly detect a stalled background worker?
You configure your worker to periodically ping Heartfly, either after processing a batch of jobs or at a set interval. If Heartfly doesn't receive this expected ping, it alerts you that your worker is no longer active.
Can I monitor multiple background worker queues separately?
Yes, you can create a unique Heartfly check for each critical background worker process or queue. This allows you to monitor the health of your various task processing pipelines independently.
What if my worker processes jobs intermittently?
Heartfly's flexible scheduling allows you to set a grace period. As long as your worker pings within the defined interval plus grace period, it's considered healthy, accommodating variable workloads without false alarms.

Related use cases