Metrics for file watchers?

Just a quick idea, as the number of inotify file watches is usually limited quite low and easy to hit with larger synced folders. Could we keep a count of how many handles Syncthing has allocated for this, to easily judge how close we are to getting watcher errors?

I’d see it under a new metrics endpoint. Probably we don’t even keep track if it yet though?

Indeed, and since it’s done in a separate library I don’t think we know at the moment.

This would be helpful.

With the 1.26 update I suddenly ran out of file watcher handles, where 1.25 had been happy. Not sure why, possibly it crept up before the update and I hadn’t monitored that Syncthing install in the last week.

For what its worth, the error message and link to docs was perfect. =)