-
mysql-audit
AUDIT Plugin for MySQL. See wiki and readme for description. If you find the plugin useful, please star us on GitHub. We love stars and it's a great way to show your feedback.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
What I would do is to persist those between restarts. If you need metrics, something like the prometheus-mysql-exporter (or any other scrapping process) can periodically query mysql for metrics, including (although not by default) performance_schema. That is what I would suggest to solve your monitoring (and would get you a robust and maintained metric system), plus counters will automatically solve the "reset to 0" on restart.
There are other solutions -e.g. audit plugins, but writing to disk on every read can be very taxing. If modifications were enough, just monitoring the last update for files on the database dirs would be a quick and dirty way to do it.