apache / cassandra-gocql-driver

GoCQL Driver for Apache Cassandra®
https://cassandra.apache.org/
Apache License 2.0
2.58k stars 621 forks source link

Can we get host from cassandra session? #1650

Open Wri0810 opened 2 years ago

Wri0810 commented 2 years ago

In java we use import com.datastax.driver.core.Session;

where from session.getStatus() we can get host name which are currently connected https://docs.datastax.com/en/drivers/java/2.2/com/datastax/driver/core/Session.html

Do we have similar implementation for any gocql cluster session get host name to which it is connected ?

martin-sucha commented 2 years ago

Hello!

Currently gocql does not have a method similar to getState in the Java driver. However, there are observers you can use to track connections, see for example ConnectObserver. Does that work for your use case?