Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Etsy's StatsD in a Windows Environment

Tags:

What will I need to use Etsy's Statsd in a Windows Environment? My intentions are to create a .net client to use Statsd.

like image 475
Christopher Avatar asked Mar 25 '11 18:03

Christopher


People also ask

What is StatsD used for?

StatsD allows you to capture different types of metrics depending on your needs: today those are Gauges, Counters, Timing Summary Statistics, and Sets. This can be as simple as adding a decorator to methods you want to time, or a one-liner to track a gauge value.

What is StatsD port?

StatsD is an industry-standard technology stack for monitoring applications and instrumenting any piece of software to deliver custom metrics. The StatsD architecture is based on delivering the metrics via UDP packets from any application to a central statsD server.

What is StatsD client?

The StatsD client is a Java library used for recording custom application metrics and JVM metrics. It is intended to be used with the Collection Agent and the StatsD plug-in. The workflow is as follows: The StatsD client sends metrics via UDP or TCP to the agent.


1 Answers

I have statsd+graphite running in my Windows environment using the C# client NStatsD.

Here are my notes for getting the Linux VM setup:

Note: I know enough Linux to be dangerous but am otherwise a noob and could be doing something unwittingly horrible.

  1. Install Ubuntu Server 12.04. I used VirtualBox for dev and then later EC2 for prod.
  2. Download graphite-fabric to your home folder. This is a script that will download, compile and install graphite and statsd. It expects a clean box and uses nginx for the web server.

    sudo apt-get install git

    git clone git://github.com/gingerlime/graphite-fabric.git

    cd graphite-fabric/

  3. Install prereq's for fabric

    sudo apt-get install python-setuptools

  4. The next steps are a download, compile and install which can take some time. It is worthwhile setting a keep alive on any putty ssh session before continuing.

  5. Now install as per gingerlime's instructions in the README.md - including the requirements section.

  6. Install statsd as per gingerlime's instructions.
  7. Reboot
  8. Execute netstat -nulp and observe 8125 is in use to confirm statsd is listening.
  9. Check carbon is running tail /opt/graphite/storage/log/carbon-cache/carbon-cache-a/listener.log. If it isn't, try sudo /etc/init.d/carbon start

Now you have your server running, try throwing some counters at it with the NStatsD client.

Timezone fix:

This will fix graphite to graph times in your local zone

  1. cd /opt/graphite/webapp/graphite
  2. sudo cp local_settings.py.example local_settings.py
  3. sudo chown www-data:www-data local_settings.py (check with ls -l that permissions look right)
  4. sudo pico local_settings.py Set TIME_ZONE to something like Australia/Sydney. Discover what timezones you can use in /usr/share/zoneinfo/
  5. Save and restart the box (not sure how to make it pick up the change without restart)

EC2 Notes

root is disabled on EC2. Fabric prompts for a root password which you don't have. Use the -i keyfile argument with fab to give it your ssh keyfile instead.

VirtualBox Notes

VBoxVMService was handy to automatically run the VM as a service in my Windows dev environment.

like image 85
fiat Avatar answered Oct 19 '22 10:10

fiat