How to Install Statsd on macOS

Statsd is a simple daemon that collects and aggregates data from various sources and sends it to backend data stores. Installing Statsd on macOS can be achieved in a few simple steps.

Prerequisites

Before installing Statsd, make sure you have the following prerequisites:

Installing Statsd

To install Statsd on macOS, follow these steps:

  1. Open the Terminal app on your macOS device.

  2. Clone the Statsd repository from GitHub using the following command:

    git clone https://github.com/etsy/statsd.git
    
  3. Change your directory to the Statsd directory using the following command:

    cd statsd
    
  4. Copy the example configuration file using the following command:

    cp exampleConfig.js config.js
    
  5. Edit the configuration file using your preferred text editor. Most users prefer using vim, nano, or emacs. I’ll use nano for this tutorial:

    nano config.js
    
  6. Scroll down to the backend section of the configuration file, and uncomment the backend that you want to use. In this tutorial, we’ll be using Graphite as the backend, so we’ll uncomment the following line:

    {
      graphitePort: 2003
      , graphiteHost: "localhost"
      , port: 8125
    }
    
  7. Save and exit the configuration file.

  8. Install Statsd dependencies using the following command:

    npm install
    
  9. Start the Statsd daemon using the following command:

    node stats.js config.js
    

Congratulations! You have successfully installed Statsd on your macOS device. You can now send data to Statsd and it will be aggregated and sent to the backend data store you configured.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!