Couchbase: Historical stats completely lost after node restarts

Hello, we recently had to restart our couchbase nodes. After the restarts, we found that the historical stats were cleared (General Bucket Analytics). I have searched around a lot and haven’t found a way to persists these stats.

This data is very useful as a baseline for tracking when things/usage changes. Please assist.

Those stats are stored on disk (by default under /opt/couchbase/var/lib/couchbase/stats on Linux), with one file per minute/hour/day/week/year.

They are normally persisted across reboots, but if you had an unclean restart or similar they may have become corrupted and hence would have been reset.

If you are particularly interested in them you can use the Bucket stats REST API to programmatically access them and archive them into whatever external stats tracking system you are using.

1 Like

Interestingly, the following directory does not exist on our couchbase nodes: /opt/couchbase/var/lib/couchbase/stats

Which leads me to believe we are missing some kind of configuration setting to allow these stats to persist. I created another test couchbase cluster and the stats directory was created.