之前看swift的code主要关注在ring,proxy-server, object-server, container-server, account-server这些组件上,一次有人问我swift如何monitoring的,哦,fuck 我漏了这里,不过我想swift使用WSGI应该比较容易在filter加一个 侦测状态的filter_factory 到原有的WSGI的Pipeline,马上去翻code,果然,这货解耦做的很强悍嘛,
https://github.com/openstack/swift/blob/master/swift/common/middleware/recon.py
1. How many unmounted (failed) drives there are in the cluster, and on which servers those are located
2. How many async pendings are present
3. Drive usage and balance
4. Load Average (for easy access later on*)
5. Memory Usage (for easy access later on*)
6. Checking ring md5sum’s
7. Logged replication stats
8. Connection stats (tbd)
9. Quarantine Statistics (a new pending addition)
WSGI filter
[pipeline:main]
pipeline = recon object-server
[filter:recon]
use = egg:swift#recon
recon_cache_path = /var/cache/swift