An HTTP server in node.js for receiving client metrics and send them to statsD.
Native apps, and client side apps, can't easily send UDP packet directly to StatsD. With this server, you can send to it, asynchronous http request, from client-side apps, letting the server send them in UDP to your statsD.
yarn... profit !
node app
or if you want to choose the port (to run multiple instance) :
export NODE_PORT=8081 && node app
export NODE_ENV=development
node app
export NODE_ENV=production
node app
/statsd/:node/increment?token=xxx
/statsd/:node/increment/:delta?token=xxx
example
/statsd/raoul/increment?token=xxx
/statsd/raoul/increment/123?token=xxx
delta value specifies by how much counter is modified
/statsd/:node/timer/:timing?token=xxx
/statsd/:node/gauge/:gauge?token=xxx
example
/statsd/raoul/timer/234?token=xxx
timing value in ms
md5sum(node + value + secretKey)
for increment, value is '1'
"rateLimit": {
"enable": true,
"lookup": [
"connection.remoteAddress"
],
"maxRequestsPerSeconds": 100,
"expire": 60,
"skipHeaders": true
}enable:Booleanenable/disable rate limit featurelookup:String|Array.<String>value lookup on the request object. Can be a single value or array.maxRequestsPerSeconds:Numberallowed number of requests before getting rate limitedexpire:Numberamount of time insbefore the rate-limited is reset (global reset)skipHeaders:Booleanwhether to skip sending HTTPX-Ratelimitheaders for rate limit
yarn test
