Skip to content

Get the node address of an executed command in cluster mode #624

Open
@longxice

Description

Hi all,

I would like to use the node address for metrics. That helps to identify which commands are sent to a node in the cluster.
However, I don't sure the way to get it.

I intend to get the node address of the executed command as follows:
Step 1: Get the key slot by calling cmd.Slot().
Step 2: Use reflection to call clusterClient._pick(...).

However, after executing the command, there may be a hash slot change caused by Redis failover.

Could you point out the correct way?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions