How to check health of docker image running sidekiq

4/27/2018

I'm using kubernetes on my cluster with several rails / node docker images. Most of them have :3000/healtz health check that simply returns status 200 with OK in body.

Now I'm trying to discover the best way how this health check can be performed on docker image running sidekiq. How I can verify that the worker is running?

-- OndrejK
docker
kubernetes
ruby-on-rails
sidekiq

2 Answers

5/5/2020

Sidekiq 6.0 ships with a new sidekiqmon, which you could use to validate that a process is running on your current machine with redis:

REDIS_URL=redis://redis.example.com:6380/5 sidekiqmon | grep $(hostname)

Documentation: https://github.com/mperham/sidekiq/wiki/Monitoring#sidekiqmon

-- endlessCoffee
Source: StackOverflow

11/6/2019

If your image is unix like, you can check if the proccess is running with

$ ps aux | grep '[s]idekiq'

But this don't guarantee that everything is working inside sidekiq and redis.

A better approach is described/developed in this sidekiq plugin https://github.com/arturictus/sidekiq_alive

I'm facing problems with livenessProbe for k8s and trying to solve without using this lib but not successful yet.

-- mateusppereira
Source: StackOverflow