statsd
Last updated
# cd /opt/graphite/conf/
# cp carbon.conf.example carbon.conf
# cp storage-schemas.conf.example storage-schemas.conf
# cd /opt/graphite/
# ./bin/carbon-cache.py start# cd /opt/
# git clone git://github.com/etsy/statsd.git
# cd /opt/statsd
# cp exampleConfig.js Config.js{
graphitePort: 2003,
graphiteHost: "10.10.10.124",
port: 8125,
backends: [ "./backends/graphite" ]
}cd /opt/graphite/webapp/graphite
cat > wsgi_graphite.xml <<EOF
<uwsgi>
<socket>0.0.0.0:8630</socket>
<workers>2</workers>
<processes>2</processes>
<listen>100</listen>
<chdir>/opt/graphite/webapp/graphite</chdir>
<pythonpath>..</pythonpath>
<module>wsgi</module>
<pidfile>graphite.pid</pidfile>
<master>true</master>
<enable-threads>true</enable-threads>
<logdate>true</logdate>
<daemonize>/var/log/uwsgi_graphite.log</daemonize>
</uwsgi>
EOF
cp /opt/graphite/conf/graphite.wsgi /opt/graphite/webapp/graphite/wsgi.pycat > /usr/local/nginx/conf/conf.d/graphite.conf <<EOF
server {
listen 8081;
server_name graphite;
access_log /opt/graphite/storage/log/webapp/access.log ;
error_log /opt/graphite/storage/log/webapp/error.log ;
location / {
uwsgi_pass 0.0.0.0:8630;
include uwsgi_params;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
}
}
EOF# uwsgi -x /opt/graphite/webapp/graphite/wsgi_graphite.xml
# systemctl nginx reloadecho "test.logstash.num:100|c" | nc -w 1 -u $IP $portoutput {
statsd {
host => "statsdserver.domain.com"
namespace => "logstash"
sender => "%{host}"
increment => ["httpd.response.%{status}"]
}
} namespace.sender.metric