Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

judhviraj_177959 avatar image
judhviraj_177959 asked ·

How do I configure the metrics reporter on Cassandra 2.0 to create a new metrics file based on size threshold?

cassandra 2.0.10 is dumping metrics file in the location specified in metrics-reporter-config.yaml for every 10 seconds. but it is dumping in the same file "metrics.out". how to create new metrics file after old metrics file has reached a threshold size.

monitoring
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

The Metrics Reporter plugin isn't part of the Cassandra code-base but I don't believe you can configure it to create a new output file based on a threshold. You will need to look at other methods to achieve the outcome you want.

For example, you can try the Linux logrotate utility. You can add the following to /etc/logrotate.d/cassandra:

/path/to/metrics.out {
  size 10M
  rotate 7
  missingok
  copytruncate
  compress
}

This configuration will rotate metrics.out when it reaches 10MB and keep 7 zipped copies.

Of course, this is just an example so see the man pages on the logrotate utility and consult with your sysadmin if you have any follow up questions since this isn't a Cassandra component. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.