I am talking to Cassandra using Hector. Is there a way that I can trace the executed queries at the server?
I have tired adding Enable DEBUG logging for org.apache.cassandra.thrift.CassandraServer as mentioned in Cassandra vs logging activity. But that does not provide much info (e.g. says slice query executed, but does not give more info).
Is there a better way?
Cassandra 1.2 introduced a new request tracing capability that will allow you to track the progression of reads and writes throughout Cassandra.
To view traces, fire up cqlsh on one of your Cassandra nodes and run the following command:
cqlsh> tracing on;
Now tracing requests.
cqlsh> use [KEYSPACE];
And I believe for as long as tracing for that node is turned on you'll continue to see traces in the CQL shell.
Alternatively, according to this follow-up blog post about advanced Cassandra request tracing from DataStax
You can configure probabilistic tracing.
nodetool settraceprobability
or via JMX
This tracing information will be retained in the system_traces
keyspace for up to 24 hours (you can change the TTL on this table), so you can query it from there later if you wish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With