Last Updated: February 25, 2016
·
1.159K
· pilt

Configure Statsd with environment variables

config.js:

(function() {
    return {
        graphitePort: parseInt(process.env.GRAPHITE_PORT) || 2003,
        graphiteHost: process.env.GRAPHITE_HOST || "localhost",
        port: parseInt(process.env.STATSD_PORT) || 8125
    };
})()

Run like:

$ GRAPHITE_HOST=somehost statsd config.js