Last active
March 24, 2017 07:28
-
-
Save niemyjski/8217e18e66df7f4f47bd to your computer and use it in GitHub Desktop.
librato statsd ubuntu setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install nodejs | |
apt-get install npm | |
cd /opt | |
git clone https://github.com/etsy/statsd.git | |
npm install -g forerver | |
cd statsd | |
nano config.js and copy the config file below | |
npm install statsd-librato-backend | |
apt-get install upstart monit | |
nano /etc/init/statsd.conf ( http://zzarbi.tumblr.com/post/43762180430/statsd-and-ubuntu-server-12-10) | |
nano /etc/monit/conf.d/statsd | |
/etc/init.d/monit restart | |
install to opt/statsd | |
/etc/statsd/config.js | |
{ | |
port: 8125 | |
, backends: [ "./backends/console", "statsd-librato-backend" ] | |
, librato: { | |
email: "MY_EMAIL_ADDRESS", | |
token: "MY_SECURE_TOKEN", | |
source: "unique-per-statsd-instance" | |
} | |
} | |
https://gist.github.com/jgeurts/6142051 | |
https://www.digitalocean.com/community/tutorials/how-to-deploy-node-js-applications-using-systemd-and-nginx | |
---> /etc/systemd/system/node-statsd.service | |
[Service] | |
ExecStart=/usr/bin/nodejs /opt/statsd/stats.js /opt/statsd/config.js >> /var/log/statsd.log 2> /var/log/statsd.error.log | |
Restart=always | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=node-statsd | |
User=www-data | |
Group=www-data | |
Environment=NODE_ENV=production | |
[Install] | |
WantedBy=multi-user.target | |
Now start the service: | |
# systemctl enable node-statsd | |
# systemctl start node-statsd | |
# systemctl status node-statsd | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment