To collect useful system metrics in Hosted Graphite such as System CPU, User CPU, Load Average, and Physical Memory you can use a python daemon called Diamond.
Diamond runs on your server, and intermittently sends these useful system metrics to Graphite. Here’s a quick primer on how to configure it.
- Install Diamond - Follow the installation instructions at https://github.com/BrightcoveOS/Diamond/wiki/Installation.
- Edit the config file - Usually located at
# Handlers for published metrics.handlers = diamond.handler.hostedgraphite.HostedGraphiteHandler
- 1.At the top of the config file, add the HostedGraphiteHandler
apikey = YOUR_API_KEYtimeout = 15batch = 1
- 2.Under the
- 3.Under the
[[default]]section, you can change how frequently metrics are reported:
[[NetworkCollector]]enabled = True[[MySQLCollector]]enabled = Truehosts = username:[email protected]:3306/mysql,master = Trueinnodb = True
- 4.On our servers we also enable collectors for network metrics and MySQL:
- More collectors - Here is a full list of Diamond collectors for various systems e.g. Hadoop, NetApp, Nginx, Postgres, RabbitMQ, Redis, and Zookeeper.
- Start Diamond - Usually with
/etc/init.d/diamond startbut it may differ depending on your OS.
Diamond should now be configured to send data to Hosted Graphite and it will appear under the ‘servers’ entry in your tree of metrics.