The problem/use-case that the feature addresses

Currently, Redis Pub/Sub client observability API is pretty limited. PUBSUB [SHARD]CHANNELS provides the active channels list and PUBSUB [SHARD]NUMSUB provides the active client count.

Description of the feature

  1. Introduce sub command for each type (GLOBAL/SHARD/PATTERN) as part of PUBSUB command to return the active subscribers (client) for a given channel.
  2. The response will be in RESP protocol (unlike CLIENT LIST text friendly output)
  3. Following values of a client can be part of the response id, addr, laddr, fd, name, age, idle, flags, obl, oll, omem, tot-mem, events, user, resp.
  4. The response will only provide the node(s) context of the subscribers.

Sub command example for global pubsub:

Request:

PUBSUB SUBSCRIBERS [channel [channel ...]]

Response: Array reply: for each channel, the client(s) connected to it and it's information (CLIENT LIST output).

Alternatives you've considered

Additional information

Past PR: #2603

Comment From: hpatro

@madolson @oranagra Thoughts ?

Comment From: madolson

I have no major concerns. Do we need a subcommand for each of these. I was wondering if it should be like:

PUBSUB SUBSCRIBERS [GLOBAL|SHARD|PATTERN] <channel name> ...