Code Stone
Code Stone

Reputation: 129

how to extend metrics of cassandra

there is a multicenter cassandra environment. and set the consistency-level=local_quorum. I want to know the latency of the local datacenter and other datacenter. What I mean is when a data is writen successfully,and what's the time that other datacenter can have the replica.

this metrics is not exposed by cassandra. Have found that writelatency is collected in org.apache.cassandra.service.StorageProxy.mutate method.

and want to add code in there to achieve collecting the latency of datacenter. but the problem is cassandra write finish when the num of write consistency-level success,I cannot block the write transaction.

how to keep the sync between write memtable and write merics

have no idea going on.anybody have idea on achieving this,pls help a look.

Upvotes: 0

Views: 67

Answers (1)

Chris Lohfink
Chris Lohfink

Reputation: 16400

There isnt anything available at this time directly, there is a ticket with patch available at CASSANDRA-11569 though.

There are some tricks you can try in mean time.

  • If you enable trace on a query (CL.ALL) you can check the trace events table to see the time that the mutations left coordinator and when it arrives on the replica.
  • You can make a local quorum write query, then a each quorum write query and track difference.

Theres a problem with some of these metrics in tracking mutations. Cassandra will piggyback all the writes in that DC over a single proxy write (vs coordinator actually sending to each node). If that node hits a GC it is likely to get a spike. Speculative retry will help with that affecting latency in an extreme case but then your not really tracking your raw cross dc latency. May want to just consider "ping".

Upvotes: 0

Related Questions