Redis's CLIENT SETNAME allows the client to give info about the connection for debugging purposes. You cannot include spaces in the ID. My initial idea is this ID:
ruby
options[:id] ||= "Sidekiq-#{Sidekiq.server? ? "server" : "client"}-PID-#{$$}"
Any other suggestions for useful info to include?
PID isn't useful in containerized environments. Hostname would be the container id and would be far more useful to me.
Good point, I'm not sure if I should assume containers or not. Notice the hammer operator; the default id can be customized:
config.redis = { :id => '...' }
I've never heard it called the "hammer operator" before. That's great.
I left it as is. The remote IP should already be available in the list of connections. The PID is there to narrow down which process on that host/container.
If your Redis server administrator has renamed the CLIENT command (to prevent CLENT KILLs):
Most helpful comment
If your Redis server administrator has renamed the CLIENT command (to prevent CLENT KILLs):